Skip to content

Comment on 2012 State of Clojure surveyparent

Comments

Time and Money are handled exactly the same as in Java.

As in using Joda-Time, Joda-Money (or JDK Money)?

Would there be any other way to represent them in Clojure? (i.e.: the more Clojure-way as opposed to use JDK classes?)

Joda Time is actually a great example of a library letting you work in terms of values instead of the mutable object disaster that is java.util.Date; it just happens to be implemented in Java itself.

If you can imagine the same benefits of working with stable values applied across the board to all your built-in data structures, that might help.

Is mixing Java classes in Clojure okay? or to some degree it is acceptable but there are gotchas or the do's and don'ts?

Hey, I checked your website just for fun and it says there you can speak Indonesian, awesome :).

Operating directly on Java classes is pretty standard. Of course you have to be very careful when working with classes which allow mutability, (true in all languages, really) but with Joda that's not an issue.

The only thing you miss out on is that Java methods can't be used as higher-order functions.

My Indonesian is pretty rusty; I should probably update it to say that I understand it rather than speak it. =)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.