4 ms·
> With Typescript things that were really easy to do on Javascript like defining a simple object were more complicated to do on Typescript. Sure defining a sim
by dugmartin 9y ago
> With Typescript things that were really easy to do on Javascript like defining a simple object were more complicated to do on Typescript.
Sure defining a simple JS object has no overhead as opposed to maybe the 15-30 seconds of overhead that creating the Typescript interface entails. But that few additional seconds of overhead gives you this for rest of the (weeks, months and years) of the systems lifetime:
1. Instant IDE/editor code completion and error checking
2. Compile time checked contracts when that object is passed to another function
3. Compile time checks for misspelled or non-existent members of the object.
4. Instant refactoring of member names across files with any number of editors and IDEs
5. A chance to take a little higher level look at the design of your system.
After using Typescript for a couple of years now I've found that when I design my types well the overall design and flow of the system tends towards beauty. That is probably why the Haskell folks are always over on the sidelines smirking.