Perspective about Java/JDK8 from a .Net developer
martijnverburg at gmail.com
Tue May 13 14:47:47 UTC 2014
Thanks for your thoughtful email! This mailing list is mainly for
discussing topics around promoting OpenJDK, and I'll reply in that vein
:-). Responses inline:
On 13 May 2014 13:58, Ciprian Khlud <ciprian.mustiata at gmail.com> wrote:
> Hi all,
> Sorry for a rant like message but this is my perspective as I want to learn
> Java at least for the sake of learning something else than the Windows/Mono
> centric experience I have from my past.
> Also forgive me for my grammar mistakes, I'm not native English speaker.
> This is how I perceive Java as for now as a .Net developer (and C++) with
> close of 10 years of programming (and some before in university & co).
> I will start with the great points:
> - Java Hot-Spot optimizer gives right numbers in benchmarks! Even more, I
> was really impressed with it
> - JDK 8 is a GREAT step forward as for me: reading all lines from a file is
> provided eventually by the JDK, or read all string without Buffered kind of
> - JavaFX feels and runs great! I was expecting to have glitches and I never
> seen one in my tutorial like experiments at least! Really good job here!
> - HotSpot defaults are great (with Tiered compilation)
That's good to hear from a developer new to Java!
Right now the not so great:
> - Java language looks primitive, and even as Lambda is definitely a step in
> the right direction. Code simplification should be done for the sake of
> language simplification. I don't have anything to promote, but after a week
> of Java, I eventually switched to Kotlin. I don't want to say that Kotlin
> is the answer, I understand that Scala is also praised
Scala and Groovy both offer a less verbose syntax. It's unlikely that Java
will go to the same lengths as those languages (or sau C#) as it is
*deliberately* designed as a "Read lots, write less of" verbose language.
- JVM startup is horrible, especially when you run multiple tools like
> running an unit test. A simple list with Kotlin (in IDE) against JDK8 runs
> in 40 seconds in my laptop. I understood that this is the "worst case" as
> many tools start, do a little work (like kotlin compiler) and after that
> stops and another tool starts, and so on! I understand, but I can say in a
> similar use-case in the .Net world takes like 2-3 seconds, maybe 5 seconds.
> I've been told that Jigsaw will fix (mostly) this and it will be part of
> Java 9. I hope it does, I downloaded JDK9 but my simple app crashes (and
> I'm not sure if it does support Jigsaw).
There is a middle ground with Java 8 called profiles (and clearly this
isn't advertised well enough). You can start a much reduced JVM now:
Jigsaw will take this further but is certainly not set in stone yet.
> - I heard about Maven but maybe I don't understand how to use it, but for a
> simple project I eventually copied jars from another project. This is
> certainly a proof of my incompetence, but I want to say that in VS like
> tools you have access to the NuGet somewhat seamless. Maybe NetBeans (or
> Idea) have this integration, but was not obvious as: "add Reference" ->
> "online" -> "search JUnit"
The Java ecosystem is heavily reliant on Maven as a dependency management
solution (NOTE: Maven is external to OpenJDK). The popular build tools
(Ant/Ivy, Gradle, Maven itself) all use it's dependency management features
(Maven has many other features as well). Most IDEs these days (Netbeans,
IntelliJ and Eclipse) all have good Maven integration support, but you're
correct in that you are required to learn a little bit about Maven first.
We tell all folks new to Java to start here:
> - I heard that in future "struct" type will be supported. I hope it does! I
> found that Java is using a bit too much memory for my taste and I have to
> make my custom queue to support compact primitives. Honestly I liked more
> the description of PackedObject, but this is a personal take. Maybe I'm
> more interested in low overhead PInvokes than low-memory Java. Who knows,
> maybe value types solve both. I am in the state of "wait and see". But as
> for me the performance of platform calls would be a better spent time than
> improving Java's good runtime performance, but maybe I'm wrong.
It's likely we'll see something in place for Java 10 - as you can imagine
the sheer amount of work required to get this into Java in a sensible and
backwards compatible manner is huge - see
http://cr.openjdk.java.net/~jrose/values/values-0.html for a *very* early
proposal (IBM also has one).
> So as in conclusion: these views are mine and are based in the try to learn
> how to make a JavaFx and OpenGl applications (I ditched OpenGL as I did
> Jogl to be hard to work with, I'm trying LibGdx now, but I am doing just
> the tutorial work) and trying to make a simple (snake kind) game.
> For the sake of comparison, all my (home) work is done in opensource
> manner. You can find the Java (NetBeans) and Kotlin projects (IntelliJ)
> here: https://github.com/ciplogic
> (skip it as a seasoned Java developer, my point is simply to say that these
> were my experiements).
Great - one of the joys of being a Java developer is the Open Source
So as lessons from the .Net world to Java (living mostly in a desktop
> centric world):
> + great runtime performance (after warmup).
> + great JavaFx (kudos once again for the team)
> + simplifying language in JDK8 is a great choice
> - slow startup (is it very bad when your final development is just invoking
> small tools up to the point of your final code, making hotSpot to not warm
> up enough. Probably Jigsaw can fix this.
> - Maven (!?) integration maybe inside popular IDEs to have a unified way to
> do stuff (!? - maybe it has)
> Thank you for reading all and if there are any resources I forgot to
> follow, I would be glad to see any resources maybe from a migration
Thanks for your mail, I hope my answers helped!
> Regards and thank you,
More information about the adoption-discuss