3 ms·
Having been exposed to OCaml, I'm starting to think that if you have null references, you don't really have static typing. I guess I'll have to look at guava, b
by andrewflnr 13y ago
Having been exposed to OCaml, I'm starting to think that if you have null references, you don't really have static typing. I guess I'll have to look at guava, but it can only help so much in interacting with other code.
- dasil003 13y agoAs a rubyist by day this is the thing I find so exciting about Haskell. I write dynamically-typed code all day, and the most common bugs are not because of passing an Apple to an Orange interface—that just isn't very common—it's because of cascading nulls. Of course Java's static checks are worth something, but not much more than the most cursory of checks that my basic test coverage does in Ruby.
- frou_dh 13y agoMy takeaway from looking into OCaml was that pattern-matching with exhaustiveness checking was the jewel, as contrasted with primitive C-style if/else chaining or switches.
- andrewflnr 13y agoRight, exhaustiveness checking is how the compiler makes sure you handle missing values (option types) correctly. I guess you could say that's one of the bigger payoffs.
- oafitupa 13y agoRuby could really use optional typing, like what PHP and Clojure have.
- fleitz 13y agoAnd especially not if you have type erasure. Java makes you type class names, and the compiler makes you cast things, as for it being a statically typed language, I'm not really sure. As with most things java it's a lot of typing for not a lot of accomplishing anything useful, but somewhat better than C. OCaml/F#/Scala have far better type systems that check a lot more things, and require less typing.
- EdwardDiego 13y ago> OCaml/F#/Scala have far better type systems that check a lot more things, and require less typing. Sure, Java's type system isn't that awesome. But it's better than not having compile time type checks.
- mwcampbell 13y agoThe static type system is still worth something for packaged client-side applications, as long as you avoid reflection. The GWT compiler (for web apps) and ProGuard (for Android apps) can do very thorough tree-shaking, because they know which code is used and which isn't.
- waps 13y agoGWT is by far my favorite way of writing javascript. It's work to get it working, but it's ironclad, has client-server RPC built in, and works on pretty much any browser out there.