But am I alone in this boat, gently rowing down the river of resistance against the *TypeScript * tide? Or are there others who share this sentiment 😍? Or better yet, are there knights in shining armor ready to defend TypeScript’s honor and educate the peasants like me on the path of righteous coding 🤣🤣?
I love Javascript but Hate Typescript!
Here are some discussion nuggets to chew on:
- Why is TypeScript hailed as the savior of big projects? Is it really the unsung hero in the sprawling chaos of JavaScript?
- For the TypeScript fans, share your “Aha!” moment when TypeScript clicked for you 😎.
- And for my fellow “TypeScript skeptics”, why do you really hate it?
Oldest comments (201)
No, you're not the only that hates it. Many also do. It's been the "trendy" thing for a long while and people prefer it because "it has better tooling".
But wait and see, the TS era is coming to an end. When some proposals for JS make it to the official spec, TS will be just a memory.
And we will be able to go back to develop for the web using the original holy trio of web dev.
Would you be willing to elaborate on why you believe TS is "trendy"? Its been around for more than a decade (longer than ReactJS) and has dominant marketshare (according to the most recent State of JS). In the tech industry, something lasting more than 10 years is quite rare, so I'm curious to understand your thoughts.
Also, would you mind clarifying how upcoming proposals making TS "just a memory" shows that TS is bad? If TS has had such a positive impact on the industry that it's principles are being adopted by JS, wouldn't that indicate that TS is significantly good? Or am I looking at this incorrectly?
it is Trendy !== Trending
Dont you see shaming for rejecting TS 😑?
I think you might misunderstand me friend. There is no shaming going on. Poster made some statements, so I asked for more information and included some facts that don't seem to support those statements.
its like someone stealing your shine!!!!
Its like when you get to realise that most of the hits of Elvis Presley were written by Black artists back in the oppressive days and they never got anything or any credit for them.
TS is like
JS looking prim and proper and getting the girl.
🤗🤗
Amen to that 😍
Well, TypeScript was written to make JS development better. If the JS spec succeeds in adding type annotations in a backward-compatible way, then TS will have reached its goal - mission accomplished.
But till that moment comes, I think there's still a VERY long way to go!
dev.to/desone/why-typescript-vs-ja...
Exactly that, if it does make it to the JS official spec then mission accomplished! But I think we're a while off from that. I absolutely hated it when we first started using it in our projects but now I can't imagine not using it unless it actually gets baked into JS.
Until Javascript becomes statically typing
nah, TS type level is another language on it own, TC 39 will not even come close to what TS can really do
In fact I would argue that TC 39 will further accelerate TS adoption because TC 39 exposes type system to JS developers, making them easier to accept TS once JS developers want more powerful type safe features
I think you misunderstand what TS is about. People don't use it because it has "better tooling", they use it because TS brings responsibility and clarity to the codebase and it eliminates a whole class of errors thanks to static type checking.
Does it have tradeoffs? Absolutely. Are they worth it? You bet your money it is. If you don't like it, don't use it in your pet projects, but please do use it where quality and team communication matters.
Exactly this. I think the dislike arises when people think TS is some magic bullet that has to be used on every project, rather than a specific solution to a specific problem that may arise in certain code bases. In this case, I think TS shines in large, distributed code bases where a lot of different devs might need to be on the same page and the code needs to be crystal clear. In cases like that, static typing would be a huge asset. Or a dev who is coming to JavaScript from a static language like C or Java and wants to keep some of those language features, it could make the language more comfortable to work with.
But for a JavaScript hobbyist working on a pet project, or a junior dev who’s still trying to wrap their head around the fundamentals of JavaScript as a whole? Of course it’s going to feel like an extra layer of unnecessary frustration because in those cases, using TS is wholly unnecessary.
I think there’s too much pressure on younger devs in general to always learn the latest and greatest thing, often at the expense of mastering fundamentals. If you’re learning React but still struggle with JS or you’re learning Typescript but haven’t tried out a statically typed language, even just a little, you prob need to slow down and focus more on the fundamentals.
Anyway, thanks for coming to my TED talk.
I see where people who dislike it are coming from, but I think the argument is mainly emotional. "I don't like the look of types and they slow me down" I keep hearing, and I was like that in the past as well. But these people forget about the huge upside which I mentioned above.
I don't think one needs a big team with a huge codebase to make TS shine as you say. I'd even go as far as saying, that whenever there is any team of devs and their project is at least semi-serious, TS is a big asset worth the effort. Unless there is a strong argument against it, like we saw in the Svelte team dropping it for DX and delivery reasons. But those cases are rather rare and very individual in their reasoning.
But of course, pet projects, students, anyone who just wants to try out programming JS, TS can be an useless overhead for you, 100%.
The way you put it, you're definitely saying TS is a must and a good practice.
I think if you really know what you're doing in JS, TS is just an extra.
I realized we never defined if JSDoc is used or not. If it is, I am kinda fine with that, but I'd still prefer TS for application development. I prefer it in lib dev as well, but I understand teams like Svelte dropping it and using JSDoc instead. If we talk not using any static type information, that's suitable only for smaller projects or those that don't have long term ambition imo.
The use of typescript is definitely a must for me, when starting either small or large projects with small or large teams, I do it because I can't deal with dynamic typing anymore, it slows me down too much, maybe not initially but as you develop the codebase you need to keep more and more context into your mind (what is being received vs what is being returned) rather than having it be inferred by the compiler, which is soo much more helpful.
I don't think I would switch to JSDoc as an alternative as I have tried it, and approached it the same way, but it turned out to be very awkward and ugly, sort of out of place, even stopped working when I spun up the project after a while...
That's fine. Opinions are like JS frameworks. There are too many of them and none is completely right or wrong.
It won’t.. JS will never have what TS has because there is no intentions to make JS “strongly typed”..
It doesn't need to be "strongly typed". That will pretty much destroy the language. But the "type annotations" proposal can help with that types ordeal.
Still won’t make JS any closer to what TS supposed to help to do.
Maybe
Most, if not all of those features come from and because of TS. Even now, you see them. For example, classes, or ahem...type annotations?
So eventually your beloved JS will become TS, just under a different name; will you hate JS then?
dev.to/desone/why-typescript-vs-ja...
Perhaps you had some kind of configuration issue going on...hoisting is completely supported in TS...
This is valid and works just fine in TS:
This is a first for me. I write Svelte in TS and function hoisting works just fine for me.
Hmmm, odd, I was just doing this for an article I wrote and get function used before its defined... I'm no TS expert - I must be me missing something.
That is a good point!
I hate that we have to accept it as it is the "trend" so to be cool you cant reject it!
No one here is saying you have to accept TS. There are legitimate technical reasons not to use it in some projects. At the end of the day, TS is a tool, just like a hammer, just like a pen. There are jobs each of those tools are good for, and jobs they aren't.
There are also people who don't prefer to use a particular hammer (maybe it's too heavy for them), or don't like using a particular pen (maybe it hurts their hand, or they like how ink flows from another pen). Having preferences is 100% fine...we ALL have them. As long as it's recognized as a preference, and not right or wrong.
I personally don't like Tailwind, for example, because I prefer to write vanilla CSS...this does not make people who use it wrong, nor do I reject it. It's just another tool, and in some cases, it may be the right tool for the job.
With all that said, you seem to want to reject TS. May I ask why you feel this way?
No, you got me wrong I dont reject TS as a choice. You can choose whatever you want as long as the community is not setting a "right or wrong" based on assumptions that who uses JS is sure building a small side thing or pushing garbage to his production and thus creating pressure that leaves no room for preference for JS
Ah gotcha, please forgive my misunderstanding. I agree with you 💯
As soon as preference starts being treated as right and wrong, it's bad...regardless of what side you are on.
No worries at all, the whole discussion is to clarify this part, to put less pressure on new comers and developers worried to come out with there preference. I am sure you already see in this community and others such pressure.
Absolutely. I see it a lot in the Tailwind community, and saw it in the React community for a while, but not so much recently.
It's funny that this pressure exists so much in the JS world. In other languages, these kinds of things just don't exist nearly as much!
I agree, maybe JS is used everywhere in so many ways that is why.
Of course Tailwind is another such example where you should be entitled to have preference no matter what are the advantages of it as you still can produce the same result (regardless of how) and no one should be pressured to use in anyway but it is happening around the clock!
You may be right! Another reason may be the lack of standards in JS as compared to other languages.
True to that
Yeah that sounds more like a linter rule maybe? TS itself definitely supports function hoisting and always has as far as I know
Really? Because it's just sitting there complaining to me about function used before it's defined when I converted over a bit of JS where I'd put the utilities at the end. You must be right I guess. oops.
You're right on the linter rule, that and the support for JSDoc in IntelliJ for showing me parameter information.
that's your eslint not typescript
Agreed, must be! Shows how often I use it I guess :)
I also hated Typescript when I just started using it, but I think I was biased then since I mainly had experience with weakly typed languages such as Python and Javascript. But, I have come to appreciate Typescript and its type safety. It also has great tooling and autocomplete. I wrote an article on this topic recently as I noticed some devs are starting to ditch TS for JS.
Could you share the source are you looking at that's showing devs are ditching TS for JS?
Here is a direct link to Ruby on Rails creator David Heinemeier Hansson post on Turbo 8 dropping TS: world.hey.com/dhh/turbo-8-is-dropp...
My blog post also highlighted other examples in the Disadvantages of Typescript section
Here is a YT video from Fireship on the topic as well: youtube.com/watch?v=5ChkQKUzDCs
Thank you for sharing these! 😃
Do you think these are examples of developers ditching TS? Or teams determining that it's not the right tool for the job they're doing?
A bit of both. David for example has a strong dislike for TS. This is obviously a contrarian stance, but some agree with him
That’s fair. 😊
I ask because I believe it’s important for us all to think through these kinds of decisions and situations. People see libraries like Svelte dropping TS and immediately jump to the conclusion that types and TS and all that is taking a dive and they should “ditch it”, but sadly, many do not take the time to understand why this decision was made. Rich Harris (the creator of Svelte) is still a big supporter of types, just not the overhead that comes with using .ts files in the context of building a library/framework/package. (if you’re interested, check out an interview where he goes over this: https://m.youtube.com/watch?v=MJHO6FSioPI&feature=youtu.be)
In the Fireship YT video you shared, he made a point to state that even in their own application, he didn’t see them moving away from Typescript. This is because the benefits of its use in large applications quite often outweighs the additional overhead mentioned above.
I love that guy! 😍
I absolutely agree with @wraith
JS rocks 😎
My aha! moment was reliable code completion. This made it possible for the inexperienced developers on my team to write working code and track down issues before runtime. Major improvement over raw JavaScript for even medium sized projects. That said, Typescript is surprisingly bad at instantiating JSON objects into reasonably typed entities.
Thanks @blakeanderson for sharing that
I think we dislike the hype, the ecosystem kind of pushing ts by force, some frameworks even go full ts. I think they oversell the problem ts is solving and sometimes you are caring thinking more about types than functionality.
In the other hand it is a good tool that can be helpful and when you give the opportunity and work for two or three projects you get used to it.
As a devs we have to care if hate is making us dish a good tool (unless that hate is for java) extreme opinions in code are mostly bad.
well said!
Indeed!
Agree 👍
I think it is also because unconsciously we hate the idea of too many unnecessary languages; they make the work for us too much....too hard. especially when you realise that this language is exactly JS 90%.
Sometimes you even have glorified identity functions just so you can get helpful type-checking
I never understand why some devs have so strong preferences over something and are willing to wage wars just to defend what they prefer. It's all contextual, they're just tools, choose whatever works for you in your context. At the end of the day, what matters is that the tools you chose and used pay your bills.
We tend to stand by our choices and defend them maybe that is why 🤗 add to that we like to be in groups and trends work by create groups (communities) and that would have loyalty!
Popular developer opinion guides the industry in that direction. When there are more developers on a certain boat, that boat ends up getting more of the love, effort, community resources, open source contributions, updates, support, and job opportunity. Developers need to shill for their favorite tech stacks because it directly benefits them when other devs hop onto the train and make contributions to add features, stability, tutorials, etc. to the exact thing they currently enjoy using.
It goes a little too far sometimes, yeah, but overall there's no helping that devs will point out the shortcomings of one technology and advocate for the ones they'd rather use instead. Mindshare is important.
Hmmm I started programming using statically types languages like C,Java.
Always hated python. Always hated the lack of type system and horrible design choices in javascript.
And Typescript is love❤️
In a proper development environment (e.g., VS Code), TypeScript provides autocompletion, typo warnings, and syntax highlighting.
I think types themselves can serve as great comments.
Can you detail what kind of projects you work on? How many developers, how many years of development, LOC, etc. Is your main issue writing TS or running TS (tools issues vs. language issues)?
The no need issue
We are a team of 18+- developers most remote, we run and have several projects (many are in production for years), myself 8+ years of development.
My main issue that it is not needed, and I dont have to put developers through requiring it, it is more like nice to have, and although it is, developers are being under a lot of community pressure if they say otherwise!
I have to say maybe you have not reached the point at which the transition cost makes it worth it:
This conversation is new within the JavaScript community but old within the overall software engineering community. It is not a battle between JS and TS; it is a battle between static and dynamic typing. All the research that I have seen over my +10 years in the sector points in the same direction:
You can read more here web.cs.ucdavis.edu/~filkov/papers/... you can find many more papers like this if you search online.
Thanks a lot for sharing 😍 very interesting even outside context of TS
And the abstract ends with:
Some comments may only be visible to logged-in visitors. Sign in to view all comments.