When I say year 2000, you say 3900, wait, what?
December 2, 2011 2:34 PM Subscribe
Recently doing more and more work in java and am wondering why was Java's getYear function was deprecated in favor of the seemingly more cumbersome and error prone "Calendar.get(Calendar.Year) - 1900" ?
It seems to run counter to the modern paradigm that methods should be named after what the do, and seems like it would generate a lot of wasted redundant code since every instance where someone wants the year from their date object, they really do want the year, not the year + 1900 that they have to manually subtract the extra 1900 from.
So, was there a compelling reason between JDK 1.0 and 1.1 that makes sense out of this change?
Bonus question, was there any pushback from the java community at the time over the change?
posted by nomisxid to computers & internet (7 answers total)
posted by Zarkonnen at 2:52 PM on December 2, 2011 [2 favorites]