Live data from Hacker News

Love It or Hate It, Java Continues to Evolve

azul.com

21–30 of 156 posts

Re: Love It or Hate It, Java Continues to Evolve

#21
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

> I suppose a decent syntax highlighter library like pygments or chroma would be nice too.

Could you clarify this? I last worked on Java in 2016 but even at the time, we had eclipse settings that had Syntax highlighters. Am I missing something?

Re: Love It or Hate It, Java Continues to Evolve

#22
post #21
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

> I suppose a decent syntax highlighter library like pygments or chroma would be nice too. Could you clarify this? I last worked on Java in 2016 but even at the time, we had eclipse settings that had Syntax highlighters. Am I missing something?

Have a look at http://pygments.org/ or https://github.com/alecthomas/chroma where you can pass code into a library and it returns highlighted HTML.

You can use Pygments in Java using Jython but its performance is questionable and can be incredibly slow when highlighting lisp code for example.

Its a very edge case for most people, but seeing as I am working on a searchcode.com upgrade I need a fast highlighter. Currently I am spawning a background Go process using Chroma to take care of this for me, but if there was a decent Java library I would use it. None exist I am aware of that are even slightly up-to date.

Re: Love It or Hate It, Java Continues to Evolve

#23
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

> Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become.

I wrote a lot of Java, but it was a long time ago. Could you share a bit of code representative of the modern Java 11 style you mentioned (var keyword, lambdas, streams, etc.)?

Re: Love It or Hate It, Java Continues to Evolve

#24
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

Agreed on all points.

You mentioned Go, so I'd like to add that Project Loom is the OpenJDK initiative to add green threads/coroutines to the JVM which I'd love. The tricky thing with "data classes" are that everyone wants something similar but different between the various terms: records, data classes, value types.

Personally, what I want from this is essentially Lombock-style all-args constructors, equals, hashcode, and toString. Struct-like like embeddability and flat object-headerless arrays are cool but honestly more niche. I don't mind sucking it up and using unsafe.

Re: Love It or Hate It, Java Continues to Evolve

#26
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

Agreed on all points. You mentioned Go, so I'd like to add that Project Loom is the OpenJDK initiative to add green threads/coroutines to the JVM which I'd love. The tricky thing with "data classes" are that everyone wants something similar but different between the various terms: records, data classes, value types. Personally, what I want from this is essentially Lombock-style all-args constructors, equals, hashcode…

Loom is rather nice, but frankly I don't find the lack of co-routines something I miss. You can spawn hundreds of real threads a second so it is possible to write Go style code in Java if you really want. I may change my mind when I actually use it though.

I don't mind what type of data classes they come up with. I just want to not have to write stupidly long constructors, multiple sets or chain-able objects when I want to populate some fields.

Re: Love It or Hate It, Java Continues to Evolve

#27
Java 8 made it an "okay" language for me to use.

It's a lot better nowadays, but historically the biggest problem with Java has been the 3rd party libraries. They tended to be written with extensibility in mind at the expense of usability. Extensibility is great, but it's not the only important thing in a design.

I'm not a huge fan of annotations. It makes the language feel a bit magical and hard to debug in some places. It can be difficult to track down how a given library actually treats an annotation - or even a set of annotations since you can put more than one on a given thing. It puts the language in a strange place: sometimes both boilerplate-heavy and magical.

> The introduction of annotations in JDK 5 has made enterprise Java development a whole lot simpler by allowing things like dependency injection.

This is a bit weird - you don't need annotations to do dependency injection. And you don't need a DI framework either. One thing I don't quite understand is the infatuation with DI frameworks in Javaland. I prefer to just do it by hand where both necessary and plausible.

Re: Love It or Hate It, Java Continues to Evolve

#28
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

did you ever try Kotlin ? whats your opinion there ?

Re: Love It or Hate It, Java Continues to Evolve

#29
post #14

Earlier quoted context omitted.

Meanwhile people are porting old features from Java into newer languages. I say newer and not more modern because it's yet to be clear that many of the new shiny languages aren't actually ahead of the game in some areas but behind in others. Maturity of their ecosystems will be a good tell down the line.

Which features do you have in mind?

Generics in Go, JavaScript class/private members, both sorting modules/dependencies are things that come to my mind.

Re: Love It or Hate It, Java Continues to Evolve

#30
post #17

In my experience most people don't like Java due to experiences they had before Java 8. This means they were used to the bloat, config as XML style world which made Java a pain to write and slow to run. Once I show them Java 11 with var keyword, lambda's and streams they start appreciating how modern the language has become. Then you throw in frameworks like javalin or sparkjava and suddenly they are not as hostile a…

I may work with java soon, so I was reading about Spring and it was yet again a dive into insane amount of verbose over engineering that I ran away from years ago.

It's true that post 8 Java becomes palatable. And someone on reddit just showed me this piece of stats:

https://www.jetbrains.com/lp/devecosystem-2019/java/

83% on java 8, java 11 nicely going up

I pity those forced to work with old techniques

Post reply on HN