News for hackers. Stuff that matters.
Re:Java 20: A Sneak Peek on the Panama FFM API by RHSeeger on Wednesday December 07, 2022 @06:54PM (#33902126)
Using an IDE for Java will, in general, make you orders of magnitude more productive. Not because of generated files or anything like that, but because it can recommend methods, auto-fill in details, add imports, etc. That kind of things saves a lot of time over the long run.
Re:Java 20: A Sneak Peek on the Panama FFM API by Waterluvian on Wednesday December 07, 2022 @06:58PM (#33902159)
Ah. I mean that’s somewhat true for any language. Is Java still super boilerplatey?
Re:Java 20: A Sneak Peek on the Panama FFM API by speed_spread on Wednesday December 07, 2022 @08:31PM (#33902934)
Java's libraries, coding conventions and culture made it verbose more than the core language itself ever required. Starting from scratch and eschewing "good practices" it was always possible to write much leaner code. Get rid of getters and setters, make every field public and final, use anonymous classes to implement interfaces inline, that sort of thing. Obviously wouldn't pass a code review at any "serious" shop ten years ago. But look at Java 20 now, with immutable records and closures and type inference? Well now that code style is now ok! But obviously my ten year old PR is still not approved...
Re:Java 20: A Sneak Peek on the Panama FFM API by papercrane on Wednesday December 07, 2022 @07:03PM (#33902224)
Depends on when you last touched Java. Lambda's (Java 8) have significantly reduced the ceremony needed to do things you'd use anonymous inner classes for. Java 14 introduced records, which makes building simple immutable data objects trivial.

It's still a fairly verbose language, but it's miles from where it was 10 years ago.

Re:Java 20: A Sneak Peek on the Panama FFM API by Waterluvian on Wednesday December 07, 2022 @07:09PM (#33902282)
My textbook says Java 6. So I guess so!

I’m kind of excited now to try it again.

Re:Java 20: A Sneak Peek on the Panama FFM API by xahrepap on Wednesday December 07, 2022 @08:18PM (#33902845)
The language has definitely evolved a lot from then. But so have the major frameworks. While not perfect, building a web app in spring boot is a whole world better than doing the same using Java-6 era frameworks.
Re:Java 20: A Sneak Peek on the Panama FFM API by kaba0 on Thursday December 08, 2022 @01:44AM (#33904969)
Java is much much shorter than Go, which oddly enough never gets this “complement”. So, take these boilerplate claims for Java with a grain of salt.

But to actually provide an answer, records shorten the language to a great degree in my opinion, there is also type inference with `var`, so on a local scope you can write really short code. The main method is still chatty, but it’s not like you actually have to write all that many times, plus it is just psvm for most IDE users.

Re:Java 20: A Sneak Peek on the Panama FFM API by peterashford on Friday December 09, 2022 @03:29AM (#33918994)
Yes! I work programming in Go. I like it a lot - its a very pragmatic language. But I couldn't believe that people who derided Java for verbosity were raving about Go. It's pretty good, but the boilerplate is extreme
Re:Java 20: A Sneak Peek on the Panama FFM API by jjfoooo4 on Wednesday December 07, 2022 @07:40PM (#33902539)
The strong typing system in Java means the recommendations and general code assistance is much more accurate and powerful than that if scripting languages