Comment by 0x445442

6 months ago

Weak/Dynamic vs. Strong/Static typing.

I used to complain about the latter then I grew up.

I am a convert as well. I wouldn’t say that I gave or grew up but that I was arguing from ignorance. On a group project someone proposed trying TypeScript and I jumped in and completely fell in love.

My only arguments against were slower development due to an imposed build/compile step and that error reports would not reflect the source code.

  • Keyboard typing speed and compile times aren't really the bottle neck for the overwhelming majority of software engineers. For them these times are dwarfed by the time it takes Service Now access tickets to get fulfilled.

    • Keyboard typing is not a bottleneck. I always cringe when I hear people cry about long method names with those really big tears.

      I did find that build times did impact my concentration during rapid experimentation or troubleshooting. When I first got into TypeScript my compile times were only 8 seconds. Then on a later dramatically larger project of around 100 files and greater than 50k lines of code my compile times got up to 30+ seconds. I switched to SWC and my compile times dropped to about 8 seconds before climbing back up to about 11 seconds. Now I am spending my time on a different project that is not as large and my compile times with SWC were about 3 seconds. I recently dumped SWC for the Node native TypeScript support and I have no compile step. It appears Node takes about 1.5 seconds to run its type stripper on my project into memory, and I am comfortable with that.

      I know those sound small, but they still interrupt my concentration compared to the almost 0 time to just run a JavaScript run time. You also have to understand I am into extreme performance and can load this one app I wrote, the UI portion of an operating system, in the browser with full state restoration within 80ms of page request.

      1 reply →