Hacker News new | past | comments | ask | show | jobs | submit login
TypeScript creator: How the programming language beat Microsoft open-source fear (zdnet.com)
3 points by alvis 11 days ago | hide | past | favorite | 6 comments





Anders Hejlsberg and Microsoft crushed my passion for programming as a day job because TypeScript is now everywhere and unavoidable. I didn't think that Ballmer could be right, but it seems that open source can be cancer after all!

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.


> 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 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).

This is only true if you code fast enough to keep your test suite and bundler at 100% utilisation.


You're right, 5x is probably an exaggeration. Maybe in practice it's more like 2x... Still that would be a lot. Often an iteration does literally take me 3 seconds; like if I just want to quickly log a variable to the console. I can find out in 2 seconds. Other times, if I made a small mistake it will take me less than 30 seconds to fix and test with JS.

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.


The thing is that TS is effectively a compiler (I know it isn't _really_ but it is in all but name). Literally millions of developers write code for languages that use a compiler very happily[1]. Having a compile step isn't a bad thing, and the fact it takes a few seconds is fine. Having a development cycle where you're concerned about how productive you are down to the number of seconds things take is just silly. The problem is with the way you work. You need to chill out a bit, take more time over your code, and think things through more. By the sounds of it you can make yourself about twice as productive just by saving your code half as often.

[1] A lot of them look at JS and TS like it's actually worse because there isn't a compiler step.


The way I work, I spend several days or weeks thinking, drawing diagrams about the main concepts and architecture, but when it's time to implement, I like to get the project done as quickly as possible. I don't usually encounter unexpected problems on projects; that's what the planning is for.

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.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: