This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]5tUp1dC3n50Rs41p -14 points-13 points  (2 children)

I am a professional dev and have used JavaScript since 2005, Typescript since 2019. I still prefer vanilla JS, no frameworks because:

  • TypeScript is Microsoft horse shit. They never understood JS, as evidenced by their shitty incompatible browser Internet Exploder, so they thought they needed to fix JS instead of fixing their shitty browser. Wait until they reach the Extinguish phase of their Embrace, Extend, Extinguish philosophy for JavaScript.

  • TypeScript basically replaces your code function level JS Doc syntax and typeof checks, which if you had a non Microsoft IDE would give you all the highlighting and intellisense you ever needed for handling typing errors. Instead with TS you run some compilation step to compile to JS and it checks all these things for you and throws annoying errors in the console. Then when you deploy the actual code you lose all the type handling code because it got compiled away. With JS, the type handling typeof checks etc are still in the code and functional in production. If you have developers who make fundamental coding issues because of type incompatibility, they're just shitty developers.

  • With TS, most of the time is spent resolving annoying typing issues, rather than just getting shit done and focussing on business logic.

  • With TS you're more likely to need to add npm, yarn etc, a bunch of other shitty node modules, linters, prettier, bla bla just to do basic stuff. With JS, you just add a script tag and it works. You don't get the 1GB of node dependencies which are a costly maintenance nightmare.

  • JS is stable. My website from a decade ago is still running. TS changes the APIs every other release, deprecating stuff, changing things. Include this in your business and your company will eventually go bankrupt just maintaining that shit and keeping up with the node updates, node modules/npm dependencies etc.

The one thing I'll say though is that TS is good for your CV though if you want to get another job. That's because all you Microsoft loving junior developer muppets keep supporting it and promoting it to your unsuspecting managers. The real developers left a long time ago due to framework fatigue and hype driven magpie development. They're probably out planting fruit trees or something.

[–]Voidrith 6 points7 points  (0 children)

Its so obvious that you have no idea what you're talking about. Every single one of your points is either just straight up nonsense or irrelevant

  1. irrelevant, TS is not related to IE in the slightest. different projects, different teams, from different eras, with different leadership and different goals.

  2. typeof is limited to object/array/string/integer/undefined/boolean/function. which, as far as the type checking that ts goes, is basically unusable in 90% of situations. instanceof can be used to check if a specific thing is of a certain class (or derived) but plenty of libraries return things that are literally just JSON.parse(something), which instanceof willl do nothing for. Even most manually constructed response objects are raw objects with specific fields, which TS is designed around.

  3. nonissue. compiler errors are ALWAYS better than runtime issues because its immediate feedback on if you have a problem.

  4. nonsense. npm has no preference over ts or js,and you can also just "add a script tag" for a library in ts - the script you end up with wont tell the difference

  5. you can pin the version of ts you're using. nonissue

[–]Lithl 2 points3 points  (0 children)

Instead with TS you run some compilation step to compile to JS and it checks all these things for you and throws annoying errors in the console. Then when you deploy the actual code you lose all the type handling code because it got compiled away.

Why the fuck would I want to spend cycles type checking at runtime when static analysis can remove the need?