TypeScript creator: How the programming language beat Microsoft open-source fear
zdnet.com
zdnet.com
These days I just do open source in JavaScript. Thankfully, I have enough passive side income to support myself without a day job (I thank my efficiency with plain JavaScript for getting myself into this position). I feel terrible for all the senior developers who know better and who are coerced into using TypeScript against their own will and cannot find an escape.
JavaScript is better than TypeScript because it doesn't have a bundling step. With JS, my development iteration speed is 3 seconds per code change... With TS, it's at least 15 seconds per code change (5 times more). This means that with JS, for the same amount of time spent on development, my code would have been tested 5 times more often (especially with TDD approach).
My approach is this; write the test case, write the code, run the test, adjust the code, run the test, adjust the code, run the test and repeat... Because I work on very complex projects, the 'adjust the code then run the tests' part is the most significant one which takes up the most time (especially with TypeScript because that part is slowed down by the build step).
With JavaScript, for the same logic, I can write many more test cases within the same amount of time (thanks to the fast dev/test iteration speed). I've verified this over and over again (I programmed in TS for many years at my last day job and also at other companies before that).
My JS code is simply better quality per unit of time spent.
EDIT But it's not so much the language of TypeScript that I hate (to be frank, it's a good language if you just consider the language itself). I hate the environment. I hate the reality of TypeScript and the economics of it which don't add up.
This is the crux of it for me, the language itself is pretty great but build steps have sucked a lot of the good parts out of front end web development.
This is only true if you code fast enough to keep your test suite and bundler at 100% utilisation.
Most of my time coding is spent on very short iterations which are 30 seconds or less. I rarely encounter problems with type mismatches or wrongly named variables or that sort of thing (and when I do, my test case catches that even faster than a TS compiler would have)... Also, waiting for the compiler tends to break my train of thought. It's a distraction and it increases my anxiety levels because I end up spending most of my programming time anxiously waiting for a result - That's why it's not enjoyable.
I hate this waiting time between when I implement the change and when I get to see the result. I think that even people who say that they like TypeScript will subconsciously feel more anxious while they're using TS. Waiting for results naturally creates anxiety; you want to minimize that time.
I'm even thinking that maybe making employees feel anxious is part of the corporate agenda to keep them under control. Maybe they did some studies and found that TypeScript caused fewer employees to leave the company? Maybe it wasn't for the reasons they believed. Anxiety tends to make people more withdrawn, less confident and stay in jobs they hate.
[1] A lot of them look at JS and TS like it's actually worse because there isn't a compiler step.
If you've figured out the right architecture ahead of time and you've solved all the obvious technical hurdles in your mind ahead of time, then implementation is very straight forward and yes iteration time makes a huge difference.