Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 399943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:53:45+00:00 2026-05-12T16:53:45+00:00

As most people are painfully aware of by now, the Java API for handling

  • 0

As most people are painfully aware of by now, the Java API for handling calendar dates (specifically the classes java.util.Date and java.util.Calendar) are a terrible mess.

Off the top of my head:

  • Date is mutable
  • Date represents a timestamp, not a date
  • no easy way to convert between date components (day, month, year…) and Date
  • Calendar is clunky to use, and tries to combine different calendar systems into one class

This post (link dead – archive link) sums it up quite well, and JSR-310 also expains these problems.

Now my question is:

How did these classes make it into the Java SDK? Most of these problems seem fairly obvious (especially Date being mutable) and should have been easy to avoid. So how did it happen? Time pressure? Or are the problems obvious in retrospect only?

I realize this is not strictly a programming question, but I’d find it interesting to understand how API design could go so wrong. After all, mistakes are always a good learning opportunity (and I’m curious).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:53:46+00:00Added an answer on May 12, 2026 at 4:53 pm

    Someone put it better than I could ever say it:

    • Class Date represents a specific instant in time, with millisecond
      precision. The design of this class is a very bad joke – a sobering
      example of how even good programmers screw up. Most of the methods in
      Date are now deprecated, replaced by methods in the classes below.
    • Class Calendar is an abstract class for converting between a Date
      object and a set of integer fields such as year, month, day, and hour.

    • Class GregorianCalendar is the only subclass of Calendar in the JDK.
      It does the Date-to-fields conversions for the calendar system in
      common use. Sun licensed this overengineered junk from Taligent – a
      sobering example of how average programmers screw up.

    from Java Programmers FAQ, version from 07.X.1998, by Peter van der Linden – this part was removed from later versions though.

    As for mutability, a lot of the early JDK classes suffer from it (Point, Rectangle, Dimension, …). Misdirected optimizations, I’ve heard some say.

    The idea is that you want to be able to reuse objects (o.getPosition().x += 5) rather than creating copies (o.setPosition(o.getPosition().add(5, 0))) as you have to do with immutables. This may even have been a good idea with the early VMs, while it’s most likely isn’t with modern VMs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Most people talk about progressive enhancement right now as serving browsers with javascript (enhanced
While looking at MVC3 examples of models. Most people tend to use model classes
Most people are aware of Using absolute positioning on a div whose parent is
Overusing Inheritance ? Java Swing and Java2D rely a lot on inheritance. Most people
As most people would by now realize with the key listener, is that in
Like most people, I have learned Rails before Ruby and now I would like
Most people would agree that internationalizing an existing app is more expensive than developing
Most people have heard of Content Management Systems. However, what basic features should an
Do most people use .NET's SqlMembershipProvider, SqlRoleProvider, and SqlProfileProvider when developing a site with
I know that most people have DirectX9-capable cards but is it really necessary to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.