4 ms·
Many people fail to see that the real benefit of using TypeScript is better tooling (code completion, intenseness, refactoring capabilities, self-documenting co
by yanis_t 3y ago
Many people fail to see that the real benefit of using TypeScript is better tooling (code completion, intenseness, refactoring capabilities, self-documenting code) and not the mere ability to catch some stupid runtime errors at compile time.
- hliyan 3y agoThis is one of the reasons I find it hard to like TypeScript. Despite proclamations about reducing errors and maintainability, I have seen many developers largely motivated to introduce TypeScript for no reason other than the ability to hit "." and see what comes next. While that is a good goal, transmogrifying a type system (and a rather weak one at that) into an IntelliSense annotation mechanism seems excessive.
- tmountain 3y agoWhy do you think the type system is weak? I was using PureScript (Haskell derivative) prior to TypeScript, and I have found its typing capabilities to be very impressive.
- IshKebab 3y agoDo you have an alternative suggestion? Because the ability to type "." and see what comes next, go-to-definition, find all references, rename symbol, etc. are all enormous time savers. Just as yanis_t said, they're easily worth it even if you ignore the significant bug reduction (approximately 15%). I don't know of any other way to get that kind of productivity boost. What would you suggest instead?
- chrisco255 3y agoVSCode and other IDEs can do . completion, go to def, rename, etc on plain JavaScript. That's not a unique feature of typed languages.
- Capricorn2481 3y agoBut find all references doesn't actually work without typescript if your data is passed around enough, and that's an important one for refactoring.
- IshKebab 3y agoNo they don't. They can make a decent guess occasionally but it's not remotely the same as in typed languages where it's accurate and works all the time. It is absolutely a unique feature of typed languages.
- solumunus 3y agoIn far fewer cases.
- DumbStarbucks 3y agoIt's comments like this that make me feel better about my own decisions. Because if that was the only benefit typescript had, it would be a win. I mean that was the whole point with JSDOC. Anything that shortens the feedback loop from writing the code to seeing if it works is a win. This is the equivalent of saying, "I see many people switching jobs for no reason other than to make more money". Like... That's the not the only reason but it's a big one. Then you get into algebraic data types, and encoding logic constraints into the type system, and you can make entire classes of bugs impossible to write. Type systems are about safety and productivity.
- mejutoco 3y agoAll of those (apart from intenseness hehe) are consequences of using a decent type system. I don’t think people ignore that IME.
- sbmthakur 3y agoJust yesterday I ran into a runtime error when I forgot the round brackets in`Buffer .contact`. This wouldn't have happened with Typescript.
- justinhj 3y agoFor a moment was intrigued what contact would do on a buffer but I think you meant concat.