Java does get a bad rap these days and it can be difficult to spend
time learning something that you are not excited about. Here is a
little more encouragement.

I was recently working on a Project Euler problem involving prime
number generation. My initial pure Clojure implementation took about
16 secs to run (This is actually fast compared to many other dynamic
languages using the same algorithm). I have some tests that run all of
my Euler solutions and this one was much slower than all the others so
I decided to work on speeding it up. I spent several of hours and got
it down to 5 seconds. I then decided I wanted to try out Clojure's
Java integration so I wrote a couple of simple static methods in Java
to replace the slower Clojure functions. Using the same algorithm but
in Java it runs in 300 ms. This took 10 minutes.

I think that the ease with which you can "drop down" to Java is one of
the best features of Clojure. I love not having to choose between
using a dynamic language and performance.

I hope this encourages you to learn some Java.

On Sep 17, 6:52 am, Hugh Aguilar <hugoagui...@rosycrew.com> wrote:
> Thanks for the encouragement. I've already got the book.
>
> I suppose eventually I will have to learn Java. I have been putting it
> off because I hear a lot of Java-bashing from programmers, and have
> also noted that this is generally the impetus for the development of
> languages such as Clojure and Scala and the dozens of others. On the
> other hand, Java can't be any more difficult than C or C++ that I
> already know. With languages such as Factor or Python I am relying on
> the bindings to C and C++ programs, so with Clojure I would be relying
> on the bindings to Java programs, which might be an improvement.
>
> Can you recommend a book or online resource for learning what I need
> to know about Java? I saw the book "Learning Java" with the tigers on
> the cover and it looked pretty good, but also pretty extensive ---
> quite a lot to digest there, which might be why they put a large meat-
> eater on the cover.
>
> If anybody is interested, I can tell you what my intended application
> for Clojure is, and you can tell me about how you would go about such
> a project. I will just be writing toy programs initially, but I do
> actually have a specific purpose for Clojure in mind.
>
> On Sep 16, 11:34 pm, Krukow <karl.kru...@gmail.com> wrote:
>
> > My recommendation would be: Don't wait learning Clojure! Start now,
> > buy Stuart's book "Programming Clojure". Once you get hungry for more
> > "real" problems, start reading up on Java - but don't waste time
> > learning too much about syntax and the many intricacies of Java
> > semantics; stick with the basics: classes, classpath, using jars and
> > standard APIs, etc. Really understanding Java takes forever.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to