by hellofunk · 9y ago · 0 comments
While I too am attracted to the static typing in many ways, I have found in my own experience of working in C++ full time for a few years (with some non-trivial work in Swift as well, which has quite a strict type system), and then Clojure full time for a few years, that when you measure all the other features of a language, typing alone does not make a big difference.
It's kind of like the argument some people make about how the cost of your rent or mortgage is the best indicator of your cost of living. There are so many other factors, and some of the lowest cost of living I've personally experienced has been in places with considerably higher rent than average, due to the offset of other factors.
On top of that, the pervasive use of macros in lisp tend to lead to a kind of code-reuse that languages without macros lack.
Not to say that Haskell can't be concise also, just not to the same degree. And I've seen very long lines in Scala that were due to pleasing the compiler's typing.
Elm and Clojurescript offer a good contrast. Elm is written in Haskell and is not too unlike Haskell syntax and general language use. I've written in both Elm and Clojurescript and there is nearly a 2X difference in code size of Elm over Clojurescript for accomplishing similar non-trivial tasks.
Code size isn't everything, but it is important.
If you still find it that hard to believe, just try Clojure for awhile, and I think it will be clear. It's a tradeoff. When you don't have to satisfy a type checker for everything, you do write less code, that's just a matter of fact most of the time.
The question is whether the increased code size of a statically-type language over a lisp makes up for the extra developer resources and potential for bloat-related bugs. But that is of course the core of the typing debate.
The original point wasn't about code size it was about bugs and I was surprised to see Clojure doing better than the very strongly typed ones. Hence the comment on the smartness of Clojure people ;)
The original point about bugs is in my opinion, regarding my comment you replied to, very similar to a discussion about code size. There are some great reads [0] that go into further depth on this issue, if you are curious.
[0] https://github.com/papers-we-love/papers-we-love/blob/master...