TypeScript has become extremely popular among JavaScript developers and more and more projects use it as the primary programming language.
Today, ...
For further actions, you may consider blocking this person and/or reporting abuse
Learning other languages is also a good idea though. Every front-end web-dev should also have a look at languages like C or Rust to get a better understanding of how many things work under the hood.
It's also a very different way to go about coding that requires a somewhat different way of thinking and problem-solving.
Agreed, besides other languages in which are used along with Typescript, the language itself has some downsides and case scenarios in which it's not the ideal language to use.
dev.to/rammina/downsides-of-typesc...
Definitively, TypeScript has some downsides. But, once you take the time, TypeScript has a lot of advantages.
You have all the advantages from JavaScript with less negative ones.
Typescript does not have all the advantages from JavaScript.
Note: I am not personally attacking you, I mean well in the sense that I don't like misinformation.
Unfortunately, I can't agree with you in good faith. Here are my counterpoints:
JavaScript and TypeScript are not the same language. Typescript is a superset of JavaScript, and it is compiled to Javascript in the end.
It is an incorrect generalization to assume that all modern framework and libraries have type definition files. In fact, there are more modern libraries that do not have type definition files.
False claim. Would you please tell me why are these humans/developers complaining about how slow Typescript compiles?
This is coming from someone who loves Typescript by the way.
You haven't understood my responses... I have always put nuances in my responses and you have miss the important notion in my response.
Maybe my writing wasn't good enough or you miss what I trying to say.
No worries! :)
I will stand by my opinion, you can have yours, and so does everyone else.
We can just agree to disagree.
"..has few downside", so does every language!
We’re not writing our code in TypeScript, why? | by Erik Westra | Kaliber Interactive | Oct, 2021 | Medium
Erik Westra ・ ・
Medium
Without having properly read the article, I can add my reason for not using TS: I value the flexibility of an untyped language more than the added safety that a type system offers.
TypeScript has quite a flexible type system. However to express some more complicated types requires quite a lot of effort and knowledge.
Important things that I think are missing:
User
) combined with actual usage (for example: the function expects something that has aname
property). It would be great if any type system would combine this. Note that this is explained better here: youtube.com/watch?v=YR5WdGrpougI think you're attributing more features to a type system than it should actually have. When you start adding predicates like "having a
name
field" you're ending up back at set theory.Might be. I was thinking more along the lines of Nominal typing vs Structural typing and in a sense a mix between the two.
I still maintain that dogmatic type-safety is a crutch to solve structural problems more than anything. I have never once thought "Well, this wouldn't have happened if this had type declarations". Not in PHP, not in Python, not in JavaScript. I've very much thought "Why did this API suddenly change?" and "Where's the goddamn documentation for this?", though.
That's not to say there aren't any benefits to an opinionated, strongly-typed language (as TypeScript would like to be). When the language is built from the ground up with the ingrained opinion that it must prevent developer error at any cost (Golang is an excellent example of this), it does have some charm. Golang in particular goes a lot further than TypeScript, though, and ironically makes you feel a lot less dirty for using
interface{}
than TypeScript does forany
(or Java does for<? extends Object>
:P )The drive to make every language type-safe obscures the real issues of language design. PHP's often confusing APIs randomly swapping argument order, Python's indifference to type inferrence, JavaScript's habit of thinking everything is a float under the hood... These issues aren't solved by making the languages type-safe. And neither does it really solve developer errors.
If anything, TypeScript in particular (due to compiling down to JS) can give you a false sense of security. Type defs are maintained often independently of the actual code mapping to them, and handling external data still runs the risk of runtime errors due to bad assumptions or changes in APIs (browsers maintaining dozens of different engine levels also wreaks some havoc at times).
Yep I totally agree with this. I use Ruby at work, Lua at home and JavaScript both at work and at home; and the types of errors I deal with are almost always related to much more complicated things than a value having the wrong type.
Having worked with languages like C and Pascal before, I'd even say it's the opposite: not having to type your variables is one less thing to keep in your head making a bit more room for the actual logic you're trying to translate into program code, so it helps with reducing bugs caused by dumb oversights.
Just as a small anecdote to underline this: The last bug I found today was that a function to calculate the length of some text was being called before the applications fonts had been fetched, so it used some default font of the browser instead and the result was off by a few pixels. No amount of typing could have fixed this, and in the end the problem was fixed by reasoning about what's happening. Those sorts of high-level problems are the ones I find myself solving most of the time, whereas type mismatches are usually a matter of reading an error message and saying "Oh, of course, this has to be a number"
Thank you so much for this article!
It's really informative, well-formatted, and I enjoyed reading it.
Overall TS brings some sanity to an insane language. Mostly helping to catching bugs before running being the primary benefit with the secondary being making it easier to reason about your interfaces, for example with
function foo(s: string, n: number): boolean
you know the expected arguments are a string and a number with the return type of boolean. All major IDEs leverage TS providing type hints.There are some disadvantages:
prop.onClick(id as number)
@ts-ignore
there's a bigger problem than TS going on.I agree with your points. We have a lot of overlaps when it comes to opinions about its downsides.
Number 4 is so awful and relatable. Even a popular library like redux-form has really bad issues with Typescript, and people over at Github and SO are struggling to find stopgap solutions to errors.
I get it, you love Typescript, a lot of people love that language, and so do I.
However, your title is clickbait and it can be misleading for beginners. The article is nice and well-written, but I'm going to have to disagree with some points.
In any case, here are some scenarios and downsides of Typescript:
dev.to/rammina/downsides-of-typesc...
Oups, spotted, I'm huge fan of TypeScript... In this article, I was trying to hide my love to TypeScript 🤣
To be fair, in my article, you can replace every reference to TypeScript by JavaScript. It also works.
My point are that both languages are very versatile.
Sure, you really love Typescript. I know you mean well.
However, it does not change the fact that some of your points are misleading, and the fact remains that Typescript is definitely not the only language you need to learn.
I'm just saying this for the sake of beginners who walk into this thread/post.
I don't want them to start thinking that all they need to learn is Typescript, because that is not true at all.
A more appropriate title and introduction would be, "Typescript is a versatile language and I love it."
Sticking to one language is simply not possible that's all.
Each language has its own dedication. There are things you won't implement using javascript but rather Golang or Python ..
Some developers will argue HTML and CSS aren't a programming language 🤣 I think it definitively make sense to build webapplication and mobile application in one language for a small team with limited resource and time.
Python has huge advantage in Data Science and the community in this field seems much more larger. Golang are more targeted to low level but for high level application like web or mobile, TypeScript can be one of the solution 😃
Lol!
Don't get me wrong , I'm not a TS hater.
But one language for everything is such a bullshit , idiotic ideology & this works only for those fanboys who are averse to learn others stuff. Never fall in love with one solution for every problem , this is like using hammer for breaking an egg. Every project has different requirements and every problem requires different solution.
Same here, don't get me wrong, I'm not a multi-programming language hater.
I started programming in PHP on LAMP stack. Doing Java & React stack for full-stack application. Making some game in C#, doing machine learning and image processing in C++, reimplementing bash shell in C from scratch, etc...
And yes, every project has different requirements and context.
I didn't give enough of my context in my article. I'm indie maker with limited time and resource. I'm currently building high-level application as a solo developer. So, one language is appealing.
Sticking to a single language for everything is the second worst thing you could do (the first is using TypeScript as only language). Nowadays it's always "use JS for everythiiiiiiing!", so I get why you would say "use TS for everythiiiiiiiing", but actually you're making a silly mistake that's hurting your developer career - but you're most likely young and think that at 30 you're old and decrepit, so it's no point arguing with you. Your approach to programming is toxic, short sighted and naive, but you got the likes and the clicks I guess it's enough for you.
Keep spreading your message, more opportunities for us older folks who can use several languages according to the needs. Cheers!
Sorry, you've made some wrong assumption... I'm an older programmer (if you consider someone above 30).
I'm a multi language programmer: I started programming in PHP on LAMP stack. Doing Java & React stack for full-stack application. Making some game in C#, doing machine learning and image processing in C++, reimplementing bash shell in C from scratch, etc... the list goes on.
I won't argue more, whether my title has been misleading whether you didn't read the article. Cheers!
That's even more surprising, so either you've hopped on the fanboy train or you've forsaken all your experience and knowledge in favor of, what? Lazyness? Having used the "right" tools for a job - for several jobs, actually - do you really believe typescript to be a valid susbstitute, or you've just making a proof-of-concept? Would you really trade C# (or even an interpreted lua) in favour of TS for game development, for example?
Your article says you "might", your title says you "ought to", you're experience says "you shouldn't and you don't".
I'm gonna be real. I personally refuse to build a social network with a scripting language. I also gave up on PHP. I've moved on to converting all of my backend to Rust for the most part. It's amazing in the frontend, but that's my limit.
Typescript is awesome for bringing some sanity to the chaos that is javascript, but even if there was a single language suitable for everything (which there isn't), it wouldn't be typescript or any javascript-based language. And I can't be alone in preferring to set my servers on fire before I'd ever use any kind of javascript outside the front end of a web stack; it just isn't a language that holds up in the worlds of strongly typed precompiled languages.
Oh, sweet summer child!
Once you open the Pandora's box of Dev tools there's no going back.
At the very least you'll learn a bit of bash, at least one database query language and whatever your favourite framework comes up with.
And when you think the worst is over, you'll end up neck-deep in DevOps and native nodejs plugins in some CPP or Rust.
After that, it'll snowball to WASM, or WebGL shader programming. Till the moment you'll find yourself spending your Saturday on Go tutorials.
The worst of it all: you'll enjoy it!
"Sticking to a single language is not ideal if you want to grow as a developer", yes, but additionaly to what you say, picking a langauge which can do many things is good skill set to have (along with others)! (Specially when you want to venture as a startup: The maximum potential of a developer).
As one can't be good in everything, but can be excellent in one thing!
Typescript supremacy 💪😎
TypeScript is the best language 🎉😛
A person who knows only one language cannot know the superiority of that language over another.
Every language has its own advantages.
Other languages have already perished from the world.