News for hackers. Stuff that matters.
Re:Java 21 makes me like Java again by justrealist on Saturday September 16, 2023 @05:46PM (#37539047)
How could you possibly like C++ but feel that Java is bloated?

Like I academically understand disliking Java but this just makes no sense.

Re:Java 21 makes me like Java again by loxias on Saturday September 16, 2023 @05:59PM (#37539157)
???

I'll answer your question with a question: Have you seen https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... ? :)

I'm guess that to those of us who remember when Java came out, "FizzBuzz: EE" is what we think of when we think of Java. :P

In Java I have to type a bazillion characters to get anything done! And make all these useless directories and files and InterfaceClassFactoryProtocolStreamingSerializer BS. And worry about how that executes.

C++? No bloat*, just speed

*Yes, there's some _optional_ bloat. But compared to Java? no contest.

Re:Java 21 makes me like Java again by bcrosby95 on Saturday September 16, 2023 @06:18PM (#37539346)
When java came out? So mid 90s c++ vs mid 90s java?
Re:Java 21 makes me like Java again by justrealist on Saturday September 16, 2023 @09:17PM (#37540519)
> In Java I have to

You have to do literally none of these things to write working Java.

Re:Java 21 makes me like Java again by OJFord on Saturday September 16, 2023 @06:05PM (#37539212)
I think people are understanding 'bloated' differently.

I agree C++ is bloated in a 'just make it a setting' / 'add this feature' / 'kitchen sink' sort of way.

I agree Java is bloated in a boilerplate, empty directories, maybe except for another directory, 'oh god the boilerplate' sort of way.

Re:Java 21 makes me like Java again by loxias on Saturday September 16, 2023 @06:09PM (#37539257)
> I agree C++ is bloated in a 'just make it a setting' / 'add this feature' / 'kitchen sink' sort of way.

Interesting. Can you expand on this, explain more? I honestly don't know what you mean or are referring to -- and I'm a heavy modern c++ advocate -- but suspect if I did it might expand my mindset/viewpoint a bit. :)

Re:Java 21 makes me like Java again by OJFord on Saturday September 16, 2023 @06:17PM (#37539342)
Honestly I haven't actually used it since C++14 was new, but it's a common complaint IME that each 'edition' (as Rust would call it, I don't know remember the term, standard?) adds too much, there's too many ways of doing things, variations of pointers, boost, and so on.

I think a lot of people wish it had stayed at say C++7, a mature C superset, but that's enough now. I probably should have said 'I understand' rather than 'I agree' - I don't feel strongly, I don't use either of them.

Re:Java 21 makes me like Java again by loxias on Saturday September 16, 2023 @06:49PM (#37539586)
Ohhh, I get what you mean now, thank you! I understand (and mildly disagree). :)

Yeah, C++ is a living language, I can respectfully see that bothering some people. I viewed c++98->c++11 as essentially a new language with c++14 and c++17 being "bug fixes" for the "new language" that is c++11. But certainly, it can require more learning about every decade now.

Re:Java 21 makes me like Java again by jjnoakes on Saturday September 16, 2023 @05:57PM (#37539135)
I think of Java as more bloated than C++ at runtime - with C++ I can make smaller executables that start up faster, use less memory, etc.

But if you are talking about the source code itself, then things are quite different.

Re:Java 21 makes me like Java again by Jensson on Saturday September 16, 2023 @05:52PM (#37539095)
C++ allows for much more terse code than java when you do small projects. It is popular in competitive programming for that reason, not just because it runs fast but also because it is really fast to write algorithms in it.
Re:Java 21 makes me like Java again by deaddodo on Saturday September 16, 2023 @06:17PM (#37539337)
I mean...Java is run through a VM while C++ is compiled to native code.

I can see that being used as a reasonable argument for bloat.

Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @03:07AM (#37542304)
> run through a VM

This is just incorrect use/understanding of Java’s execution model. It does have a runtime, but it is definitely not a VirtualBox VM.

Re:Java 21 makes me like Java again by deaddodo on Sunday September 17, 2023 @11:49AM (#37546356)
What are you talking about? No one brought machine/platform virtualization into this conversation other than you.

The bytecode interpreter for Java (and other similar languages) is literally called a Virtual Machine, due to the way it functions:

https://en.m.wikipedia.org/wiki/Java_virtual_machine

It would seem your understanding of the Java execution model is flawed.