Are there any cons to using Joda-Time?

后端 未结 7 1719
我在风中等你
我在风中等你 2020-12-02 13:12

I want to convince the architecture manager to include the Joda-Time jar in our product.

Do you know any disadvantages in using it?

I think Joda-Time needs t

7条回答
  •  -上瘾入骨i
    2020-12-02 13:32

    I've had almost entirely positive experiences with Joda Time. My one problem was when trying to construct my own time zone (for legitimate reasons, I assure you :) I got some very weird exceptions, and the documentation wasn't very good for that particular use case.

    However, for the most part it's been a joy to use - immutability makes code a lot easier to reason about, and thread-safety for formatters is hugely useful.

    Yes, there are files to keep up to date - but at least you can keep them up to date. It's not like they contain things which were unnecessary with Java's built-in stuff, it's just that with Java's mechanism you just couldn't keep information like timezones up to date without significant hackery!

    Basically, +1 for using Joda Time. The Java date/time API is one of the worst bits of the Java platform, IMO.

提交回复
热议问题