By madlep
via rawblock.blogspot.com
Published: Sep 08 2007 / 17:28
The one thing I've always liked when working with static type systems, and one that is often glossed over when discussing dynamic typing systems, is how easily tools can interpret and navigate code. When coding Java in Eclipse, it's amazing how easy understanding a massive code base can become. You've got simple hyperlink navigation, sophisticated refactorings, and smart code analysis that can show you what is called from where and how. Even interfaces and figuring out which implementation is used (which is kinda dynamic typing for Java) can be groked easily with a good IDE.
Comments
FlySwat replied ago:
A great example for this is strongly typed datasets.
This allows the IDE to give you code completion based on table/column names and is a huge time saver when writing database code.
Compared to the alternative of passing the column name as a string and having to go look at the database schema and make sure you have it right.
Ricky Clarkson replied ago:
You're mixing up static typing and strong typing. Programmers in dynamic languages don't tend to use strings for everything.
Qrilka replied ago:
You miss the point.
E.g. if you have dataset.x = 11 in statically typed language you'll get an error if field x is a string, but in dynamically typed language you'll get an error ONLY in runtime, so to check this you need to write some unit tests at least (which should be better written anyway :) )
Craig Tataryn replied ago:
But then again if the language supports boxing/unboxing then the dataset.x=11 might be perfectly valid.
Qrilka replied ago:
With boxing (in Java/C#) you'll get Object which is not a String to get it working you need implicit casts
Ricky Clarkson replied ago:
If x is a string, why are you writing x=11?
TopTorials replied ago:
I totally agree!
daniel replied ago:
I tend to agree with Julian on this point. Don't get me wrong, I love dynamic typing and all the benefits which come with it (like duck typing). Most people don't realize how liberating it is to just never worry about type issues. However, in a large scale application, where you need to actually *maintain* your code, static typing is extremely useful. I couldn't imagine writing an IDE in Ruby any more than I could imagine writing a quickie script in Java.
Ricky Clarkson replied ago:
I assume that most programmers of dynamic languages build their projects from smaller parts, rather than making one big codebase. That's probably how they make their code maintainable.
AshleyF replied ago:
Type inference can make a static typed languages feel very much like a dynamic one - get the best of both worlds! (e.g. F#)
Voters For This Link (29)
Voters Against This Link (4)