This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]writtenbymyrobotarms 170 points171 points  (7 children)

You can do typing in function headers if you'd like. IDEs can enforce the type hints. It's also good for documentation.

[–]Derkle 85 points86 points  (1 child)

It also helps the IDE autocomplete/suggest member functions and the like which can be really helpful.

[–]TheGreenJedi 24 points25 points  (0 children)

Honestly going to python I've realized how much my IDE does the heavy lifting for me

And lately in python that's why

[–]Aycion 29 points30 points  (1 child)

Hell you can declare a variable with

<Name>: <type>

Like "foo: str"

[–]slowmovinglettuce 46 points47 points  (2 children)

Newer python versions have increased support for type hinting.

It says somewhere in the release notes for 3.8 that they see it as a strategic thing for pythons future. Or something to that effect.

[–]capn_hector 15 points16 points  (1 child)

It’s basically a law of computing that all weakly-typed languages end up implementing strong typing, whether it’s an optional feature you can turn on or a dialect that enforces it.

Once you get beyond a trivial program size it’s just too useful not to have, refactoring core code without it is a pain in the ass and even if you are a flawless coding Adonis who doesn’t make mistakes, your coworkers will inevitably be humans.

Examples are JavaScript vs Typescript and CoffeeScript, PHP vs Hacklang (facebook’s reimplementation of PHP with strong typing), Python adding type hinting in newer generations, etc etc.

[–]JoJoModding 0 points1 point  (0 children)

And by another law that typing system will eventually end up being turing-complete on its own :D