4 ms·
I think I also agree that TS has made js programs harder, but not in a bad way. You see there was a quote back in the day about a discussion between a senior c
by seer 5y ago
I think I also agree that TS has made js programs harder, but not in a bad way.
You see there was a quote back in the day about a discussion between a senior clojure developer and a java one, and it went something like this.
Java dev - “How do you know when you refactor your app that if you change something in one place, it will not cause a problem in another distant part of the app, without the compiler to help you” And the clojure dev answers with “why would you ever write an app where one thing in one place changes another thing in another place?” I forgot where it was from though.
Anyway the sentiment is that clojure gives you tools to write an app like that where all the things that affect each other are close by, so it is actually possible to write big apps without types.
TS on the other hand gives you tools to write a big app where things _can_ affect different places, but you can still manage it. You can “fit” a bigger app in your brain.
JS by itself gives you no tools whatsoever so you’re at your own mercy, so you’re either more careful, or don’t write big programs and stay small. Or alternatively invent strategies that help organize things (redux, express, react).
TS allows you to ignore all that, write a horrible mess, and still be able to ship and be productive. It makes bigger messes actually possible.
Now I’m a huuuge fan of TS myself and never start a frontend project without it. And I also think it can make code, especially functional code much better and easier to reason about.
But we’ve lost the natural selection of JS projects. Before TS, if you’ve not setup your project right, with test, structure, policies and processes it was doomed the moment it grew to a certain size. You either stayed small, did it right or failed and refactored. Now … now you can actually keep going for much much longer with just TS helping you. And god forbid the TS wiz that sets it all up leaves and you’re left with untangling a mess. It’s a nicer mess, but a bigger one.
- tacotacotaco 5y agoYes thank you. This was the point I was trying to make.