Earlier quoted context omitted.
I have to disagree. Adding the types will increase the number of the characters/lines of code which with a 80-char formatter limit can make functions look almost gibberish at a glance. Do that on a whole codebase and it becomes a mess to look at.
And I have to disagree in turn. Those additional characters and lines of code are documentation, and turn gibberish into not only human-readable clarity about the code you’re reading, but a machine-traversable dependency graph as well.
TypeScript is now officially 10 years old
181–190 of 207 posts
Re: TypeScript is now officially 10 years old
#182I feel like I am the only one in the world not liking typescript. It is not that I don't like types, it is what those types do to the readability of the codebase in terms of verbosity. My original programming language was Java but I switched to Node.js because I liked the simplicity of the code written in it. Nowadays every Javascript project seems worse than a Java project in terms of verbosity. My main gripe with p…
But TS is very viral by nature. You can only go in one direction (JS -> TS). TS promises "type safety", which is mostly a lie, but sounds really good. It also promises to be purely additive, so choosing it seems like a no-brainer. TS is a next step in a JS-engineer career, once you learn it it's hard to admit that it was a waste of time. Especially when there's nothing but praise around, humans are conformist by nature.
Being viral doesn't make it good. But it means that it will keep spreading, until community gets a TypeScript fatigue.
Re: TypeScript is now officially 10 years old
#183Earlier quoted context omitted.
C# is extremely popular, maybe just not in your particular field.
“My field” is a 20+ year MS ecosystem developer from C++/MFC, VB6, .Net Compact framework, .Net Framework, .Net Core, etc. As I said, very few new companies that aren’t “legacy” shops are choosing .Net. In my current job in cloud consulting at $BigTech, almost all of the .Net projects that come through are older companies compared to newer companies that are using non compiled languages. These days I write in almost…
“My field” is a 20+ year MS ecosystem developer from
C++/MFC, VB6, .Net Compact framework, .Net Framework,
.Net Core, etc.
Right, and in that field you might be correct (I don't know but I'll take your word for it). It is however not the entire software industry. As I said, very few new companies that aren’t “legacy” shops are
choosing .Net.
I'm a game developer and the most popular game engine (Unity) uses c#. The newest up and comer (Godot) uses their own scripting language or c# as the most popular options. I've also worked in Enterprise before and c# and java were the popular choices there and as far as I know from friends still are (especially when servicing the government)Re: TypeScript is now officially 10 years old
#184Earlier quoted context omitted.
You still have bugs, you just haven't found them yet. When strict typing is not available you adjust and use other tooling and tests. Of course with a big, venerable project the balance changes drastically. But an experienced single-person project should be doable with javascript for a long while and may even get to MVP faster by focusing on things that are essential.
I’ve been coding professionally for 39 years. ts seemed very strange to me at first. Only even started using it because I had to do some customization in NetSuite and some third party type and build support in ts made comprehensible the typically-stilted and insane NetSuite js required by SuiteScript. Now I’m addicted to it. Specifically the lightweight and easy to use _interface_ directive feeds my practice of self-…
Re: TypeScript is now officially 10 years old
#185Earlier quoted context omitted.
And I have to disagree in turn. Those additional characters and lines of code are documentation, and turn gibberish into not only human-readable clarity about the code you’re reading, but a machine-traversable dependency graph as well.
The problem is that they are forced documentation. You can't choose to skip it after you became familiar with it.
Re: TypeScript is now officially 10 years old
#186Earlier quoted context omitted.
It's normal not to be aware of the types when encountering code for the first time, or after a long absence. Your described experience is the rare exception when working with third party vendors, on long lived projects, or with teams that are not trivially small.
So the benefits are only available once or twice, but the code is going to be verbose forever. If I were to come up with environment where it is guaranteed to be a net positive it would be a company with lack of boundaries between teams and a lot of churn. Essentially TS averages out engineers in your team. You're going to be slower, but more predictable. Your 10x engineers will become 5x, but 1x will become 2x.
It’s the other way around. For more experienced engineers TypeScript is a huge productivity multiplier: you can fly around a large code base with ease, making changes all over.
More experienced engineers also probably have some history with other statically types languages (perhaps Java, Swift or C++) so the concept of static typing is likely to be familiar to them.
For less experienced engineers, there are more drawbacks such as 1) additional language complexity and 2) possible unfamiliarity with static typing. Although TypeScript still a productivity boost because they are likely to have a higher error rate.
Re: TypeScript is now officially 10 years old
#187Earlier quoted context omitted.
I find it catches a lot of design mistakes for me which I would put in the non-trivial bugs category. Many bugs that result from design mistakes are less immediate, like hard to spot edge cases (a better design makes them impossible) or code that lends itself to becoming messier and more bug prone in the future as it's changed/extended (a better design makes this less likely).
I’ve had the opposite experience with complex type systems. They make it harder to evolve out of bad designs. This is particularly true when a lot of inheritance is used.
However TypeScript’s structural typing is much more flexible, because it is designed to describe the types of all the existing JavaScript code out there (via the DefinitelyTyped project).
This gives the best of both worlds: the freedom to express the architecture you need, plus the freedom to actually refactor an existing code base into that new architecture without introducing many bugs. Dynamically typed languages give you the former but not the latter.
Re: TypeScript is now officially 10 years old
#188Earlier quoted context omitted.
> But for any sane developer having made the mistake to touch TypeScript, the capability to strip the types and run the code with broken types, is essential. You’re free to hold that opinion, but I think you see (based on downvoting) that your definition of a “sane” developer is not as universal as you may have thought. Personally I almost never see any value in running known broken code. If I need to run/test a subs…
>your definition of a “sane” developer is not as universal as you may have thought Where I'm from, sanity has historically been the minority opinion, so we don't really have a word for this, but I think the English one is... "gaslighting"? "TS is a superset of JS", "there are 4/5 lights", "this line is longer/shorter", etc. (Look those up if you haven't, Microsoft marketers surely have.) What I'm saying is, I am well…
You are conflating santity for your subjective opinion. I guess your post might have been received better if you showed more awereness of that.
> That's completely subjective.
Yes. Which is why i prefixed "Personally I...". I'm clear about this being my opinion, not an universal truth.
> Personally, I don't know how to fix a piece of code without being able to see with my own eyes how/where/why it breaks
If the compiler tells me I'm passing a string to a function expecting a number, I find that error pretty easy to grasp, and I don't need to run the code to know how to proceed from that error-message.
> But TS is not a static language, where types actually matter; it's a restrictive "sanity checker" overlay on top of a dynamic language.
Sure. But if you (and that's up to you!) decide to write your code using types and allow TypeScript to check them, at least you know that your code in isolation is unaffected by whatever dynamic runtime it will end up being run on.
> And not one that's good enough for me to sacrifice the expressivity that JavaScript allows.
So you prefer to go full iron, and rather trust the correctness of your own code, than having a compiler check it for you.
That's your choice, ofcourse, but if that's how you do things, you cannot come afterwards and claim that TypeScript is a bad language based on that. It's a bad match for you, and how you would rather manually be in control of everything.
But just tells us about how you like things, it says nothing about the language itself.
> we get all these (generations of) people with the impression that JS is a "low sanity" language...
Javascript as a language has lots of quirks. Lots of quirks which are unexpected to most developers not coming from Javascript. That is to say, Javascript behaves differently than most other programming-languages.
I'm not saying it's wrong or "not sane", but programmers coming from other languages will make assumptions and those assumptions will be wrong for "plain" Javascript, leading to buggy code.
Typescript embraces the modern parts of Javascript, and makes them easy to work with, and makes your code easier to prove correct than plain Javascript would. That's why people like it. That's why people use it.
> and that it needs, of all possible features, even more of a type system.
This is not specific to JS. I think any language used to build bigger systems benefits from having a type-system to ensure the components interacting are always interacting in a known good way.
To me it seems like you're one of those people who prefers to work with all the quirks that Javascript provides and considers those to be good things, even though they are (much) harder to formally verify.
Where Typescript tries to force you to make formal declarations for your code, you find those limiting or getting in your way. Great. Be a superstar if you like.
Me (and many others) on the other hand, are just human, and we like a compiler to tell us about obvious errors in our code without having to discover them at runtime, or even worse, in production.
Re: TypeScript is now officially 10 years old
#189Earlier quoted context omitted.
I always felt the decision to write flow in ocaml was ahead of its time. Flow compiler is much faster than TS. Native bundlers like esbuild, swc etc. are mainstream now but they came much later.
But writing Typescript in Typescript allowed the language-designers to dogfood the developer-experience of being a Typescript-developer. Just like MS eventually did with C# too. After the C#-compiler was reimplemented in C# (Roslyn), that’s when the language was truly allowed to develop. And it also made it much easier to make C# a truly cross-platform language. When the language-designers don’t have to use their own…
I don’t know. I tried to understand the OCaml code and contribute to Flow, and in the end I nope-d my way out of there.
Re: TypeScript is now officially 10 years old
#190Earlier quoted context omitted.
“My field” is a 20+ year MS ecosystem developer from C++/MFC, VB6, .Net Compact framework, .Net Framework, .Net Core, etc. As I said, very few new companies that aren’t “legacy” shops are choosing .Net. In my current job in cloud consulting at $BigTech, almost all of the .Net projects that come through are older companies compared to newer companies that are using non compiled languages. These days I write in almost…
“My field” is a 20+ year MS ecosystem developer from C++/MFC, VB6, .Net Compact framework, .Net Framework, .Net Core, etc. Right, and in that field you might be correct (I don't know but I'll take your word for it). It is however not the entire software industry. As I said, very few new companies that aren’t “legacy” shops are choosing .Net. I'm a game developer and the most popular game engine (Unity) uses c#. The n…
In the US, the companies that pay top dollar - the large tech companies and well funded VC back companies are not adopting tech companies.