top | item 42375908

(no title)

steinuil | 1 year ago

Python actually has a good typed ecosystem these days, and unlike JS -> TS you don't have to add a compilation step to benefit from it: you just have to enable type checking in your IDE.

JS is in a different spot where to benefit from type checking you have to add a build step or reconfigure your build tool, switch files to another extension, add some "type stubs" dependencies, and make significant changes to the codebase to benefit from type checking.

I think if Node and the browsers started allowing type hints in their parsers you'd see much less resistance to TypeScript.

Other scripting languages are probably not popular enough to matter as much as JS does.

discuss

order

qayxc|1 year ago

> you don't have to add a compilation step to benefit from it: you just have to enable type checking in your IDE.

It's similar for JS, believe it or not. Type hints via jsdoc can be just as easily configured for type-checking in our IDE of choice.

Python type hints aren't mandatory either, so they're strictly opt-in and nothing stops users from ignoring them.

steinuil|1 year ago

I know, I've used jsdoc type hints and I don't like them very much. They're verbose, types and names are the wrong way around, there's about two or three different syntaxes for defining any one thing, you don't get any autoformatting (AFAIK)... I'm not a fan.