Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m inclined to say that any magic applied here is a win. Making things complicated with Typescript is simply hard enough that those people that’d mess things up in the first place wouldn’t even consider trying.


Yes, let's write everything in assembly language. Only the real pros will dare touch that! /s

Complex to understand code does not entail high quality of maintainers. Quite the opposite in my experience.


That was not my point.

Writing simple types with Typescript is simple, and improves any Javascript code.

Writing complex types (inference, generics, inheritance) is really punishing. And people that don’t truly know what they’re doing won’t even try (or at least in my experience, I’ve never seen them try).


It's the dreaded "I know enough to be dangerous" type that you have to worry about; the people who don't actually know all that much but enough to make a mess of things. I was brought in to help for a while on a project where they had compile times up at 4 or so minutes, if I remember correctly. The solution in the end really was just "Write dumber types", because their types were completely overboard and written just well enough to work.

A big bulk of their compile time came from things that could've been checked in much more efficient (for the compiler) ways.

I would never urge anyone to not use statically typed languages, mind you, I think people just need to be a bit more pragmatic. Sometimes I find it unfortunate that TypeScript provides the facilities it does while still not having solved the basic ergonomics of types (more consistent inference, etc.). Having types that generate types creates problems that I honestly don't experience anywhere else and I would rather that people just not in general, but that's something you can fix with rules.

An ironic part of all of this is that Haskell's type system is a lot easier to use and use well than TypeScript's, in the end, which is especially funny considering all the talk of pragmatism.




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

Search: