3 ms·
The real truth though is type safety isn't a hassle. If your framework/libraries are already typed, then you will actually save a huge amount of effort. When
by wvenable 8y ago
The real truth though is type safety isn't a hassle. If your framework/libraries are already typed, then you will actually save a huge amount of effort. When you're working on your own code then you already know the types of the parameters; it takes only a moment to type them out. And then from that point forward, the mental effort is decreased because it's one less thing you have to think about in the code.
Type inference solves all the issues where entering type information was redundant and stupid. I will admit that old-school Java is maddening to work with for that reason but those days are long past now.
- sephoric 8y agoNot only is TypeScript's typing system less verbose, but it's smarter than old school (Java-esque) type systems. I just released a new version of Autumn[1] this morning that uses TypeScript's union types and type literals, and has this built-in: `type ModString = "command" | "control" | "option" | "shift"` so that now, even though you're still passing strings to Hotkey.activate, the IDE will actually warn you if you pass a typo like "comman". Not only that, but if you press Control-Space (same as in VS Code), it will actually auto-complete valid options for you. TypeScript is full of little goodies like this that are IDE-friendly, which is why I chose it for Autumn instead of plain JavaScript or Lua. [1] the best macOS window manager: https://sephware.com/autumn/ https://sephware.com/autumn/
- GordonS 8y agoI'm primarily a C# guy, so I'm no stranger to static typing - TypeScript's type system is a real joy to work with. Between C#, F# and TypeScript, the three seem to be borrowing more and more from each other as time goes by (e.g. default interfaces and nullable reference types are coming in C# 8). It almost feels like they'll all converge at some point!
- ivankolev 8y agoC# and Typescript are both co-developed by Anders Hejlsberg, so no wonder.
- Belphemur 8y agoWhy it make it a string enum then? You can do that in any typed language too.