Stuart Gunter

  • Contact

Static type checking is good, but…

November 9, 2012 Posted by Stuart Gunter under Uncategorized
No Comments

Ignoring the usual arguments for/against statically/dynamically typed languages, there’s a more subtle danger I’ve seen lurking in the shadows of some statically typed programmers’ minds.

I’ve heard the words “it’s only JavaDoc” too many times to count lately. That seemingly innocuous statement can be pretty dangerous, because you’re in effect saying “I might have completely changed the meaning of what this class/method does, but it’s ok ‘coz it compiles” . You might be mislead into believing that a small change in documentation here or there is no big deal, but the meaning of the words you use impacts the expectations of the developer that’s using your code. Something as small as changing “will” to “should” can carry a significant semantic shift that might be a lot more devastating than perhaps changing the type signature. Statically typed languages might tell you when there’s a compilation error, but they will not always tell you when the contract has changed!

I don’t know what programmers using dynamically typed languages do – because I’ve only used them for playing around on pet projects (so far) – but I’d imagine (or at least hope) that a higher value is placed on docs than what I’ve seen in many programs written in statically typed languages.

If you’re not convinced, here’s a little something to mull over: if word choice is not important, then RFC 2119 was a waste of time!

Share this:

  • Share
Tags: , Java

Leave a Reply Cancel reply

Couchbase Maven Plugin »
Search
Recent Posts
  • Static type checking is good, but…
  • Couchbase Maven Plugin
  • Configure Java 7 in IntelliJ IDEA 10.5 on Mac
  • Running a Clojure Script in a Maven Build
Archives
  • November 2012
  • September 2012
  • August 2012
  • July 2012
  • May 2012
  • March 2012
  • December 2011
  • March 2010
  • February 2010
Recent Posts
  • Static type checking is good, but…
  • Couchbase Maven Plugin
  • Configure Java 7 in IntelliJ IDEA 10.5 on Mac
  • Running a Clojure Script in a Maven Build
Stuart Gunter powered by WordPress and The Clear Line Theme

Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.