News for hackers. Stuff that matters.
Re:The Oracle Java Platform Extension for Visual Studio Code by fullarr on Wednesday October 18, 2023 @12:29PM (#37931038)
Stop using Java just let it die for the love of all that is holy
Re:The Oracle Java Platform Extension for Visual Studio Code by marginalia_nu on Wednesday October 18, 2023 @12:35PM (#37931118)
It's more alive than it has been in years.
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @01:11PM (#37931628)
It's not going anywhere due to masses of legacy code. It's less of a popular choice for new projects than it ever was.
Re:The Oracle Java Platform Extension for Visual Studio Code by marginalia_nu on Wednesday October 18, 2023 @01:18PM (#37931721)
I'd totally pick Java for a new project in 2023.

The stable and mature ecosystem and fantastic tooling along with very low amount of library churn makes it one of the better options for anything server-side.

Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @04:17PM (#37934204)
You get all of this by choosing Kotlin or Scala.
Re:The Oracle Java Platform Extension for Visual Studio Code by marginalia_nu on Wednesday October 18, 2023 @04:21PM (#37934270)
Yeah, but why though? Seems like mostly a bandaid for old Java version.
Re:The Oracle Java Platform Extension for Visual Studio Code by exabrial on Wednesday October 18, 2023 @05:46PM (#37935209)
I agree with this. Java8, Java17, and Java21 make Scala/Kotlin far less appealing while being mainstream.
Re:The Oracle Java Platform Extension for Visual Studio Code by pjmlp on Thursday October 19, 2023 @04:27AM (#37940065)
The only reason to pick Kotlin instead of Java is because Google says so on Android.
Re:The Oracle Java Platform Extension for Visual Studio Code by talent_deprived on Wednesday October 18, 2023 @01:23PM (#37931815)
It's probably the most widely chosen language for new projects today across the board from enterprises to startups.
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @04:19PM (#37934242)
I've not seen a new project started in Java in a decade, and it's pretty far down in the StackOverflow developer survey [1]. Do you have some data to back your claim up?

[1]: https://survey.stackoverflow.co/2023/#section-most-popular-t...

Re:The Oracle Java Platform Extension for Visual Studio Code by empthought on Thursday October 19, 2023 @07:07AM (#37941180)
Every language above Java in that list (except possibly TypeScript) is forced by the development target or domain. JavaScript and HTML are forced by web dev. SQL is forced by databases. Python is forced by machine learning. Bash is forced by targeting UNIX.

Also there’s no such thing as “an HTML project” or “a SQL project.” So I don’t think your survey link is telling you what you seem to think it’s telling you.

Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Thursday October 19, 2023 @06:20PM (#37949562)
What Java Application can't be written in Javascript/node?
Re:The Oracle Java Platform Extension for Visual Studio Code by marginalia_nu on Thursday October 19, 2023 @07:06PM (#37950022)
You can write anything in JS, but it's not suitable for a great deal of things.
Re:The Oracle Java Platform Extension for Visual Studio Code by The_Colonel on Wednesday October 18, 2023 @01:53PM (#37932239)
Java/JVM is still the best platform for large/complex/enterprise server applications.
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @04:16PM (#37934198)
Java is not the JVM. Lots of new projects on the JVM go with Kotlin or Scala.
Re:The Oracle Java Platform Extension for Visual Studio Code by wiseowise on Wednesday October 18, 2023 @05:15PM (#37934873)
JVM is the Java. It is literally reference implementation. JVM changes to accommodate changes in the Java language, not the other way around.
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @05:53PM (#37935283)
Are you saying that there are no other languages than Java that target the JVM?
Re:The Oracle Java Platform Extension for Visual Studio Code by belfthrow on Wednesday October 18, 2023 @06:51PM (#37935872)
No he's saying that java gets the features implemented from the bytecode spec first. And you well know it, or maybe you have no idea and are just a kotlin fan boy...
Re:The Oracle Java Platform Extension for Visual Studio Code by vips7L on Thursday October 19, 2023 @07:47AM (#37941562)
The VM also knows about Java the language, its idioms, and language features. It’s a two way street.
Re:The Oracle Java Platform Extension for Visual Studio Code by The_Colonel on Wednesday October 18, 2023 @07:18PM (#37936099)
You're loose with the terms. Java is not "literally reference implementation", it's the platform language of JVM.

While this is a major advantage, Java has also its fair amount of problems, some of them unfixable (or rather, the Java team is unwilling to fix them). It looks like Java will never get a proper fix for the whole in the type system named null, while there are some great languages running on JVM solving that.

Re:The Oracle Java Platform Extension for Visual Studio Code by wiseowise on Thursday October 19, 2023 @02:51AM (#37939405)
Whatever problems it has, Java calls the shots on JVM.
Re:The Oracle Java Platform Extension for Visual Studio Code by pjmlp on Thursday October 19, 2023 @04:25AM (#37940057)
Nah, a drop in the Java ocean outside Android.
Re:The Oracle Java Platform Extension for Visual Studio Code by sigzero on Wednesday October 18, 2023 @02:03PM (#37932364)
That is simply not true. In the Enterprise space it is probably in the top two.
Re:The Oracle Java Platform Extension for Visual Studio Code by leosanchez on Wednesday October 18, 2023 @02:33PM (#37932760)
What's the other one ? C# ?
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @04:20PM (#37934250)
What does "Enterprise space" even mean?
Re:The Oracle Java Platform Extension for Visual Studio Code by Scarbutt on Wednesday October 18, 2023 @05:22PM (#37934956)
Medium to big companies outside the HN bubble.
Re:The Oracle Java Platform Extension for Visual Studio Code by jupp0r on Wednesday October 18, 2023 @05:57PM (#37935319)
Do you mean non-tech/non-software companies?
Re:The Oracle Java Platform Extension for Visual Studio Code by redditor98654 on Thursday October 19, 2023 @06:51AM (#37941057)
No quite. Amazon (including AWS), Google, Netflix, Snowflake. From my own personal experience.
Re:The Oracle Java Platform Extension for Visual Studio Code by dlandis on Wednesday October 18, 2023 @04:30PM (#37934376)
> It's less of a popular choice for new projects than it ever was.

Totally disagree. I think it was at its trough of popularity in the Java 8 initial release timeframe around 10 years ago, when many companies were still stuck on Java 6 and other languages had moved way ahead. In the last few years, since around Java 17, there has been a ton of enthusiasm and I think it would be the best choice for a huge number of use cases.

Re:The Oracle Java Platform Extension for Visual Studio Code by wiseowise on Wednesday October 18, 2023 @05:13PM (#37934845)
> It's less of a popular choice for new projects than it ever was.

[Citation needed]

Re:The Oracle Java Platform Extension for Visual Studio Code by locopati on Wednesday October 18, 2023 @12:47PM (#37931302)
Java is the new COBOL, though modern and more vibrant obviously, and that's not a bad thing. Plenty of work to be had for a long time to come.
Re:The Oracle Java Platform Extension for Visual Studio Code by pron on Wednesday October 18, 2023 @01:13PM (#37931659)
COBOL is probably better compared to PHP or Ruby. COBOL was never as popular as Java, and its popularity was relatively short lived; by the time it was 20 it was quickly falling out of favour. In 2023, Java is the #1 most popular language for serious server side applications, and is in the top 3 overall on pretty much any language ranking you can find. In terms of longevity and super-popularity, its only counterparts are C, JS, and Python. Comparing Java, or Python or JS for that matter, to COBOL completely misses both COBOL's history and the current state of the ecosystem.
Re:The Oracle Java Platform Extension for Visual Studio Code by sabareesh on Wednesday October 18, 2023 @01:12PM (#37931640)
Care to explain why. I am in favor of all the maturity of several libraries and framework
Re:The Oracle Java Platform Extension for Visual Studio Code by mrkeen on Wednesday October 18, 2023 @03:37PM (#37933668)
No minds will be changed here, but -

I use the termal and I make binaries for my use. I'm not going to try to pipe input through several stages of "java -jar myUtil.jar", even if I bother to clear the hurdles of trying to find and configure the right maven plugin to build a "fat" jar.

Null drives a big hole through whatever you try to achieve with the type system. Need a Key for this Lock? Open the Lock anyway, just find out at runtime that the Key was null, rather than at compile time.

Bizarre omissions from the standard library. What do you do with Sets: Union? Intersect? Nope, write them yourself. Wait for a multiple futures? Write a for-loop. Cancel a future? Forget about it. Wait - better than forgetting about it: include cancel() on the class but make it a no-op.

Non-extensible. Let's say the language designers for some reason didn't put takeWhile into Stream. Can you add it?

No way to avoid mutation in order to avoid non-local reasoning about state. If I submit a list as a parameter or accept a list as a parameter, who else has mutated or will mutate that list.

No transactions. Synchronised blocks don't compose: synchronised get() and synchronised set() do not become synchronised getThenSet();

I'm sick of the 'backward compatibility' at all costs. The 'legacy code' that you're thinking of that you don't want to break was written after any of these problems could have been fixed.

Re:The Oracle Java Platform Extension for Visual Studio Code by wiseowise on Wednesday October 18, 2023 @05:19PM (#37934922)
> I use the termal and I make binaries for my use. I'm not going to try to pipe input through several stages of "java -jar myUtil.jar", even if I bother to clear the hurdles of trying to find and configure the right maven plugin to build a "fat" jar.

https://docs.gradle.org/current/userguide/distribution_plugi...

> Null drives a big hole through whatever you try to achieve with the type system. Need a Key for this Lock? Open the Lock anyway, just find out at runtime that the Key was null, rather than at compile time.

https://github.com/uber/NullAway and bunch of rest.

Re:The Oracle Java Platform Extension for Visual Studio Code by bobsmith432 on Wednesday October 18, 2023 @01:14PM (#37931665)
What's wrong with it? I don't program really (at least yet) and Java actually seems like a neat language to learn.
Re:The Oracle Java Platform Extension for Visual Studio Code by ecshafer on Wednesday October 18, 2023 @01:54PM (#37932251)
Nothing is wrong with Java.

Java has some plusses and minuses like any language.

Java has:

* Fantastic concurrency support (Better than Javascript, Python, or C)

* One of the largest most mature library systems in existence, with far fewer amateurish "left pad" type libraries like Javascript or Python

* Supported basically everywhere by any vendor you can imagine

* Pretty good strong type system to reduce bugs, and making refactoring very easy

* plethora of frameworks for your use case, whether its server side rendering, monolithic apps, Raw SQL or ORM, microservices, reactive.

* Probably the best tooling and ides in software development.

* getting lots of new features to alleviate pain points with the newer rapid development

Negatives for Java:

* C# has linq

* Type system isn't as advanced as OCaml

* Generics have type erasure due to backwards compatibility

* verbose and lots of boiler plate

Re:The Oracle Java Platform Extension for Visual Studio Code by mschuster91 on Wednesday October 18, 2023 @02:45PM (#37932929)
> * Probably the best tooling and ides in software development.

Agreed on the IDEs, nothing can beat IntelliJ... but general tooling? Definitely not. Maven is a hot mess of XML where people tend to do horrible horrible hacks just to survive, and Gradle projects tend to be even messier because of Groovy's syntax allowing about five different ways of doing the same thing.

Re:The Oracle Java Platform Extension for Visual Studio Code by vips7L on Wednesday October 18, 2023 @04:09PM (#37934120)
I'll give you gripes with maven/gradle (even though maven tends to just work for me), but look at all of the observability tools like Mission Control, Flight Recorder, and VisualVM. What other language has all of this?
Re:The Oracle Java Platform Extension for Visual Studio Code by wiseowise on Wednesday October 18, 2023 @05:17PM (#37934895)
> Gradle projects tend to be even messier because of Groovy's syntax allowing about five different ways of doing the same thing.

Spoken like a true "I've never seen Gradle beyond copy pastes from Stackoverflow". Modern Gradle is all about plugins written in Kotlin. Your buildscripts shouldn't have anything beyond `implementation` block.

Re:The Oracle Java Platform Extension for Visual Studio Code by mschuster91 on Wednesday October 18, 2023 @06:18PM (#37935546)
> Spoken like a true "I've never seen Gradle beyond copy pastes from Stackoverflow".

Which is what the majority of legacy, grown Gradle scripts are in my experience among multiple government and private companies' projects. The older the project, the worse state the build scripts tend to be. The worst I ever encountered was a project that was mainly done with Maven, but that called out to Gradle and Ant for weird manipulations to get the build artifact to the formats required... gives me nightmares to this day.

Re:The Oracle Java Platform Extension for Visual Studio Code by bobsmith432 on Thursday October 19, 2023 @02:18PM (#37946490)
Is it any good for beginners?
Re:The Oracle Java Platform Extension for Visual Studio Code by paul_e_warner on Thursday October 19, 2023 @10:42AM (#37943584)
There's nothing really wrong with it, but it's core design is pretty outdated in ways that are difficult to fix without putting together a totally new language. Couple of examples

- Support for nullable values. Swift and Kotlin have first class support for these, which are meant to minimize or reduce the number of null pointers in your code. You can mostly fix this with annotations, but those your team using them very consistently, and are not supported by most java libraries.

- It's approach to concurrency. Java built in synchronization primitive is based upon an older model of concurrency whose name I cant remember but it involves every object basically being able to maintain internal consistency with it's own state. No one still uses it like this, with most method creating an `Object lock` as a synchronization primitive.

- Serialization. Java has built in binary serialization support that ended up being a massive security hole. Most people are now forced to use some json serialization, but the old serialization format is still lurking in the background to ensnare less knowledgeable programmers.

- Generics. Smarter people than me can probably give you more detail on this, but generics were grafted on to the language long after it was introduced, and it shows. At runtime, there are no generic types kept, meaning it is technically possible to break the generic typing of an object.

None of these it should be noted are deal breakers or reasons why you shouldn't use the language. Almost every single one has some form of workaround for it. But if you're not aware of them (or stuck with an older legacy codebase like a lot of people are) they can be major headaches that can just be avoided by using a more modern language.

Re:The Oracle Java Platform Extension for Visual Studio Code by mikece on Wednesday October 18, 2023 @01:27PM (#37931871)
After 20 years of writing C# I was planning to pick up Java as my go-to language.
Re:The Oracle Java Platform Extension for Visual Studio Code by leosanchez on Wednesday October 18, 2023 @02:34PM (#37932770)
What's wrong with C# ?
Re:The Oracle Java Platform Extension for Visual Studio Code by mikece on Wednesday October 18, 2023 @04:14PM (#37934170)
It's open source now... I miss the restrictive licensing. Call me weird.
Re:The Oracle Java Platform Extension for Visual Studio Code by leosanchez on Wednesday October 18, 2023 @04:39PM (#37934475)
You are weird :D
Re:The Oracle Java Platform Extension for Visual Studio Code by gorjusborg on Wednesday October 18, 2023 @03:48PM (#37933842)
C# and Java are so close they could be siblings.

If you want to grow, I'd look at diving into a language with a fundamentally different paradigm like Common Lisp/Clojure/Scheme/Erlang/Elixir/F#/OCaml/Haskell.

Re:The Oracle Java Platform Extension for Visual Studio Code by jayceedenton on Wednesday October 18, 2023 @01:48PM (#37932163)
Honestly, Java has a lot going for it. Amazing library ecosystem. Simple to learn, like Go but with essential quality-of-life improvements. Community without PLT sadists. Fast as all hell when written with care. Vast variety of jobs. Super-polished dev tooling.

I know there problems too (verbose, OOP and enterprise over-design, some horrible legacy systems) but Java is as strong as ever I think.

I'm interested, have you worked in Java before on a bad project and have scars, or have you built up a negative impression from afar?

Re:The Oracle Java Platform Extension for Visual Studio Code by gorjusborg on Wednesday October 18, 2023 @03:45PM (#37933785)
..and a real debugger

> have you worked in Java before on a bad project and have scars

My guess is that the opinion is just used as a way to signal their status as a 'pro' developer much in the same way people used to hate on PHP/Perl/VB/etc. endlessly.

Ironically, this makes them look like amateurs posing as pro developers, as real pro developers demonstrate their status through their work, not their posts on social media.

Re:The Oracle Java Platform Extension for Visual Studio Code by shepherdjerred on Wednesday October 18, 2023 @02:27PM (#37932677)
Aside from the meme-y "Java is slow" argument, what's wrong with Java? What language would you use instead?

Java has an incredibly mature ecosystem, and Java 11/17/21 fix a _lot_ of the problems Java had.

Re:The Oracle Java Platform Extension for Visual Studio Code by exabrial on Wednesday October 18, 2023 @05:41PM (#37935159)
No. Java is awesome.