4 ms·
This article doesn't really bring anything new to the table; it's yet another rehash of "some errors can be caught at compile time and dynamically typed languag
by lvh 13y ago
This article doesn't really bring anything new to the table; it's yet another rehash of "some errors can be caught at compile time and dynamically typed languages do not do this so they are bad".
The article claims that dynamic typing can lead to hard-to-track bugs. That is certainly true, but only paints half a picture: for example, in dynamically & strongly typed languages such as Python, Clojure or Erlang, you'd get errors instead of the wonky type-changing behavior of a weakly typed cousin such as Javascript. Secondly, just because dynamically typed languages do not catch certain classes of bugs at compile time doesn't really say much unless you leave out testing, which can catch way more bugs, including ones that the compile-time type checker won't.
The final paragraph says a lot:
Duck typing is nice for rapid prototyping but you
may not want to use it in any production code. It’s
terrible to debug, hard to test and sometimes leads
to bugs occurring extremely rare.
The article does not make the testing argument and only makes the sometimes-hard-to-debug argument.
Dynamically typed languages can be used to produce reliable systems just fine; consider Erlang.
- masklinn 13y ago> unless you leave out testing, which can catch way more bugs, including ones that the compile-time type checker won't. 1. which sadly tends to be the usual state of the industry, as distasteful as it is. Static typing bringing some sort of "mandatory testing" is thus something of an argument. 2. good static type systems also make testing easier, see e.g. specification testing (quickcheck) in Haskell versus Erlang. I think Haskell's is much more enjoyable. 3. Dependent typing. > The article does not make the testing argument and only makes the sometimes-hard-to-debug argument. Which is not really correct anyway, most people who've had to debug C++ templates soup don't argue that it's easier to debug than Python code.
- ldarcyftw 13y agoAgree, the article is quite shallow. It misses refactoring support (not reliable in dynamically typed languages) and better code reading experience (go to definition/find usages as examples).