10 ms·
Agreed. The majority are beginning to realize that strong type systems are actually helpful instead of a mandatory annoyance. Most programming I've done in the
by swalladge 8y ago
Agreed. The majority are beginning to realize that strong type systems are actually helpful instead of a mandatory annoyance.
Most programming I've done in the past has been with python (no type hinting) or languages with weak static type systems (java et al). Having to verbosely specify the types in java was always just painful, while the upfront speed and freedom of python felt much nicer. However after getting a taste of better type systems by dabbling in rust and elm, now every time I write something in python I'm thinking "was argument a string or a foo class?" or "that runtime error would not have happened if the type checker caught it".
Python type hints now are a huge plus for the language. It still seems a bit "hacky" though. I'd love to see something that adds more syntax sugar and feels more built in. Maybe it's just me.
- outworlder 8y agoI would be like to be able to specify types at integration points (module level, function level, etc). Function arguments do benefit from clear inputs and outputs (is this type X? a list of X? A list of anything? Is it returning Y? List of Y? Nothing at all? An error or nothing? Something that is just like X but with an extra field?) Inside the function? Leave me alone. You are a computer, go figure out. Which seems to be the direction we are heading towards. > was argument a string or a foo class Oh, it was supposed to be a string. However, it is a string that came from the UI, so it is untrusted, so your SQL function should refuse to use it. But hey, feel free to lowercase it. The main problem is that usually type systems are not very rich, so the baby gets thrown out with the bathwater. Also, runtime errors are ok if they happen in your test cases. You do have them, right? :)
- swalladge 8y ago> Also, runtime errors are ok if they happen in your test cases. Yes, but if some errors can be caught sooner by your linter/IDE/typechecker then it speeds up development. Would you rather be notified of a type mismatch immediately after saving the file or later when you run the test suite?
- icebraining 8y agoYeah, my only experience with static typing early on was C and Java, and it turned me off the whole thing. I could understand the advantage in C for the whole close-to-the-machine thing, but Java's verbosity and poor expressiveness while allowing NPEs everywhere felt really silly. Idris is what's bringing me back to typed land.