3 ms·
IMO this is a ridiculous complaint. First, if "var" was such a huge problem then language like python would be totally unusable! The entire language doesn't ha
by UncleMeat 7y ago
IMO this is a ridiculous complaint.
First, if "var" was such a huge problem then language like python would be totally unusable! The entire language doesn't have explicit static type definitions.
LHS type inference is a tool. Like literally anything else you can write code that makes things less maintainable using this tool. The languages that support LHS type inference all have style suggestions that you use it when the type is either not especially relevant or is clear from the expression RHS. People don't complain about type names when they are useful. People complain about type names when they are extraneous noise. That is when LHS type inference is useful.
- ncmncm 7y agoSome of us do think this about Python, at least for serious work. Many, many Python programmers admit that code in it needs a lot more testing to make up for the lack of built-in type safety, and guard against runtime violation traps. So, no, it's not ridiculous. Overstated, possibly. But I am less interested in Go than ten minutes ago.
- UncleMeat 7y agoThat has nothing to do with textual type annotations. That is just Pythons lack of static type checking.
- munchbunny 7y agoTextual type annotations and static type checking tend to go hand in hand. There's no point in using type annotations if the language doesn't do anything to validate that they are true.
- UncleMeat 7y agoTONS of languages don't have written type annotations all over the place and still have static type checking.
- saghm 7y ago> There's no point in using type annotations if the language doesn't do anything to validate that they are true. Yes, but there's _plenty_ of use for static type validations even if you don't use type annotations.
- crdoconnor 7y agoIf there's some level of confidence you're missing when using python because of the explicit types, you'd be better off making up for it using asserts rather than additional tests.
- munchbunny 7y agoI think his point is that Python developers often do wish that they could have type validation written into the language, rather than having to litter code with assertions. I certainly feel that way.
- NateEag 7y agoAdd MyPy to your build process (or just your local editing setup) and you can: http://mypy-lang.org/ http://mypy-lang.org/ (Disclaimer: I've not used it, I just think it's a reasonable idea.)
- crdoconnor 7y agoI think his point might actually have been the point he made rather than the different point you made.
- munchbunny 7y agoThat's a roundabout way of saying "no you're wrong" without saying why you think so. Why do you think so?