I keep seeing posts of some drama with typescript. What happened?
My who-the-fuck-cares-what-I-think-but-here-it-is-anyway take: Typescript is the only way I can write Javascript without feeling vomit in my throat.
[This comment has been deleted by an automated system]
Honestly I’m surprised Microsoft isn’t pushing for that already. They already have a decently popular browser (Edge), they own TS, and they have a history with not giving a shit about standards (IE and ActiveX).
[This comment has been deleted by an automated system]
Same boat: people who hate typescript and therefore ensuring type safety probably also hate unit tests because they are too inconvenient to awesome rockstar developers.
I love unit tests but I hate the eternal struggle behind them.
We should make unit tests so we can tell when the build runs that the app is going to be consistent
Everyone cheers
We lose a sprint setting up unit tests
Oh this one test just went yellow, somebody spends a few hours figuring it out and finds that it’s a bug in the unit test. No no we’re good That’s just a bug in the unit test we’ll plan to fix that in the next Sprint.
Oh look now this unit test is going red we’re blocked. 2 hours later they find out that it’s a real problem but it’s not so bad that it overrides current feature work. Well we’re going to need to override that and we’ll have to fix it in the next sprint.
Unit test failures slowly degrade in priority to try to get feature work done. You end up with a backlog full of yellow and red known problems and no one pays any attention to you that tests anymore.
Lmao I’ve literally had conversations with people who have asked me to not be as rigorous with unit tests because you have to change some tests when you make a modification to the business logic.
Bro: that’s the fucking point.
Can’t be a 10x developer if you keep spending your time writing unit tests.
I feel like (and it was created by Microsoft which would support this) the purpose of TypeScript is to make web development palatable for C#/C++/Java developers.
I’m not really involved in javascript land so im parroting off of what i’ve heard for “why js over ts?”
- it reduces file size since you no longer need to ship source maps
- ctrl+clicking stuff will take you to the definition rather than an unhelpful type declaration
- if you spot a bug in the library, you can edit the source directly than having to recompile/reimport
- ts adds some unnecessary type “gymnastics” (can’t speak for what this means), when all they really want is intellisense thru jsdoc
So mainly: devs who don’t prefer strongly typed languages, and library devs who find typescript to be less transparent and more time consuming for new and old contributors than it’s worth
- Why do you have to ship a source map? It compiles to vanilla js
- Not sure what editor, but in neovim (which uses tsserver on my end for LSP) I can either jump to the type declaration or the actual implementation. This is a tooling problem not inherent to typescript
- This doesn’t make any sense. You’d have the same problem with minified js or css etc.
- It means they are forced to use types properly and do the tiniest bit of thinking and planning that results in fewer type errors (think undefined variables and properties, etc)
Not a bad summary, but I take issue with all the points
Edit: The sourcemap comment is relevant to package size and not to final bundle size per the HN comment linked below. Also, the cmd+click critique rings truer now that I know it’s in the context of an installed package. Another critique is build time which is fair enough.
I understand why some hobbyist individuals with small-ish scripts might not see the value, even though I even still disagree there.
The more code and people touching the code, the more value you’ll see.
Where do y’all get your programming drama? I’m missing out
https://lemmy.world/post/4786575
Saw a couple of posts like this one.
Edit: I just went on local new on programming.dev and this was the second post: https://programming.dev/post/2807882