I think dynamic typing has its place, but more in experimental design and prototyping than in bigger application development (big IMHO).
I think dynamic typing has its place, but more in experimental design and prototyping than in bigger application development (big IMHO).
So its popularity is really historical incident, in particular I think, that it was the first hack (see worse is better) to allow to easily deploy dynamic web applications (via web-server side interpretation of code, which got popular in Apache). Furthermore PHP hosting is still very popular in low-cost bundles to integrate e.g. Wordpress.
Clojure is another nice language, but could benefit from typing. :p Maybe the main "problem" for dynamic languages ist the fact that it requires more discipline on the Programmer's side, so I imagine it is popular for smaller teams, but this is hard to achieve for bigger development efforts, where you can benefit from a stronger type system.
This is why I wish Groovy with it's combined static / dynamic typing abilities was a) better and b) more popular. Its ability to interweave static and dynamic typed code is really spectacular when it works. Unfortunately there are a lot of holes and it can still be quite painful when in static mode, so I mainly only use it for performance rather than as I would like to - as the default mode.
Having said that, I've actually since found Clojure to be better than Groovy at testing Java classes. A well-placed macro can often cut out syntactic clutter when testing some repetitive scenario.
1. You can detect very common errors (e.g. typos) at compile-time instead of maybe detecting them at run-time. This makes the code much much more reliable (or equivalently you don't need to do nearly as much testing).
2. Dynamic typing prevents IDEs from doing extremely useful things like real code completion and symbol renaming.
If you're thinking "but I edit Javascript with code completion" or "code completion isn't such a big deal" then it's probably because you've never used accurate code completion, e.g. Microsoft's Intellisense for C++, or pretty much an Java IDE.
1) Common Lisp implementation use a compiler to detect typos, etc.
CL-USER 21 > (defun bar () (fo0))
BAR
CL-USER 22 > (compile *)
The following function is undefined:
FO0 which is referenced by BAR
2) In Common Lisp one can ask the running Lisp system for information about classes, symbols, functions, etc.The use cases for renaming are also completely different. If you take for example a Java class and you want to rename an attribute and update the getter/setters you might want to use a 'tool'. In a dynamically typed language like Common Lisp, this is often not necessary because code generation is widely used and changes can be propagate that way.
(disclaimer, I have never been in the Army or any military force and the above post is based on my imagination and watching films)
Neither approach is wrong, but most developers have (sometimes very strong) opinions on which is the right way to do it in various different cases.
That's not true if you seriously unit-test your code base, which you should in both cases.
Strong typing is awesome. I personally think that dynamic typing is wonderful, too, but opinions vary about that.