Making Sense of Java's Dates
Subject:   The Horror!
Date:   2003-06-05 04:54:32
From:   jimothy
The Calendar class is certainly a frightening mess of an API. What's worse is so many developers subscribe to the Gospel of Sun: Whatever Sun does must be right.

A few years ago, I was reviewing code written by a colleague, and, instead of multiple getXxx() and setXxx() methods, it had one get() and one set() method. I questioned him on why he chose this approach, and he replied, "This is what Sun does in the Calendar class." The impression I get is that he, and Sun, chose this approach out of laziness, even though the requisite getter and setter method could have easily been generated automatically.

The moral here is not new: You will write your code once, but it will be read many times. Take the time to make proper design decisions, or all will have to suffer.

1 to 1 of 1
  1. The Horror!
    2003-06-08 21:12:40  anonymous2 [View]

    • The Horror!
      2003-06-08 22:33:10  anonymous2 [View]

1 to 1 of 1