3 ms·
> Types almost never save the day and they don't add much to the understanding. There’s a saying in strongly typed languages “make illegal states unrepresentab
by tiew9Vii 6y ago
> Types almost never save the day and they don't add much to the understanding.
There’s a saying in strongly typed languages “make illegal states unrepresentable”.
Java doesn’t let you get all the way there but it’s better than nothing.
When you look at strongly typed languages with a good type system, often when you compile it just works.
Besides hello world, I’ve never written program beyond a few lines that has just worked in a dynamic language.
...I do like clojure and the repl workflow and how everything is data. Haven’t done much besides play with it but have a friend who writes clojure professionally on a large codebase and their feedback is most of the errors they now see wouldn’t exist with a type system.
- kaliszad 6y agoCan you be more specific about your friends codebase? How large, what industry/ problem space? Of course, you can write bad/ unmaintainable code in any language. I have seen such code in Clojure(Script) as well. But some languages really encourage bad code where other languages already feel like you are doing something wrong when you write bad code. (e.g. Using many atoms in Clojure, doing boolean transformations etc. just from the top of my head.) Strongly typed languages in my experience don't help anything, make programming harder for everybody and the benefit is (for most software) questionable. Compilers should handle most types for us and only give us a hint something could be better, if we were more specific e.g. with a type hint. Humans should think about the problems not about deep implementation details (like integer vs float vs double), when not strictly needed.
- fulafel 6y agoSchema systems (like spec and malli in the Clojure world) work well for checking states in data and are more powerful and ergonomic for that than type systems in mainstream languages.