That's not true. Dynamic languages, also called scripting languages, have a totally different purpose than statically typed languages. Scripting languages should be used when code needs to written fast, mainly by a single programmer. The focus is on programming speed, not on maintainability. Static languages are for projects that are better planned, often worked on by a group of programmers and that need to be maintained by different persons for a long time. You loose programming speed due to typing but produce more solid code due to type checking, that can be better maintained.
To fit these two different purposes scripting languages and statically typed languages need different language features beside the typing story.
For the quick and dirty approach it is perfect to have closures with all their potential side effects and runtime errors while it is very bad to have them in long living code.
Therefore I like to use closures in Groovy for quick hacking but would hate to see them in Java. They add complexity and solve problems that Java shouldn't have. |