3 ms·
Honestly I've never understood this argument that choosing types is too complicated. Most often I've seen it come from people without much experience in statica
by raiflip 9y ago
Honestly I've never understood this argument that choosing types is too complicated. Most often I've seen it come from people without much experience in statically typed languages and imagine that having to determine the type will be difficult.
After becoming familiar with the code base or library, particularly with modern IDE's it's rarely taken more than 10 seconds to choose a type. When reading another person's code, it does take some time to map out the relationship between the classes, but unless your code is in one giant file/function/object you're going to have to figure that out anyway.
- christophilus 9y agoI've programmed professionally in statically typed languages for > 15 years. (C#, various VBs, C++, F# (which is rad), and lately TypeScript) I've also dabbled in Haskell, OCaml, Rust, and a whole lot more. In fact, outside of Clojure, I've never liked a dynamic language (and I've used a few professionally). So, I'm someone with plenty of static-language experience, and I am in the boat that types are more complicated, in some ways. Just today, I had to figure out how to wrangle TypeScript into a shape I needed (and wound up with a solution that I didn't like but which got me past the compiler errors and on to more important work). There is a cost. There is also a benefit. So the question is, what does the cost/benefit analysis yield? Regardless, Clojure is worth learning. It's an amazing language.
- tome 9y ago> Just today, I had to figure out how to wrangle TypeScript into a shape I needed (and wound up with a solution that I didn't like but which got me past the compiler errors and on to more important work). It would be really interesting, and indeed probably the most valuable contribution to this whole discussion, if you could write up what the problem was and why it wouldn't have occurred in Clojure!
- wellpast 9y agoFrom Rich's talk: "Now at this point I was an expert C++ user and really loved C++, for some value of love." Rich has had many years of experience in statically typed language.
- pklausler 9y agoPlease don't use C++ as an exemplar of static typing. There are much more powerful and congenial alternatives. It would be just as unfair if one were to claim that dynamic typing is bad because assembly language tends to be buggy and expensive to maintain.
- Tehnix 9y agoThe type system of something like C++ and Java are so far removed from the type systems of Haskell or Idris, that it is silly to compare these two.