Hacker News new | past | comments | ask | show | jobs | submit login

Java vs. the 90s C/C++ standards. Not having to deal with memory management made it so much easier to write applications.

I'm guessing SQL was a 10x innovation at least when it came out, too.




+1 for this. Java gets shade from the hipsters these days, but it's almost impossible to overstate what a revolution it was for software engineering.


Java had an impact similar to COBOL in the previous generation of business apps. I used to call it COBOL for the 90s.

If you don't know COBOL, it was a revolution compared to programming in Assembler. It's hard to overstate how big an improvement it was for productivity.


Java brought two things to the table compared to C++: garbage collection, and an enormous library.

I don't think that garbage collection, by itself, was a 10x change. For it to be so, programmers would have to be spending 90% of their effort on freeing memory. Don't get me wrong, garbage collection is a big win when you can use it, but I don't think it's quite that big of a win.

The library... that might almost be 10x, by itself, because of everything that you don't have to write. The combination of that plus garbage collection gave Java quite a kick compared to C++.


Not freeing memory, but tracking down memory leaks. We rarely even hear that term nowadays, but most large commercial programs used to have them.


Memory leak is a thing on JVM too. Tends to reoccur at times.

Java brought call stack dumps, security model and alot of standardisation across orgs.


Or you just reference things all the way through your program, so it's possible in every language.

Still, for the memory management related kind in C++ there are tools like valgrind.


I was part of the C++ -> Java revolution, and I'd add the language being much simpler than C++. It felt like a rare, real 80/20 thing where you get 80% of C++'s power for 20% of the complexity.


In the 90s I used to spend DAYS hunting down memory issues (corruption, leaks, crashes) in C++ code. Your whole schedule could slip by weeks because of one hard to reproduce issue. I haven't seen that kind of problem in a long time.


+another huge benefit - Jar files and class files made the IDEs possible. Studying at the university, moving from Visual Studio/C to Eclipse/Java was a wtf-how-is-that-even-possible moment.


Java saved me from having a C++ career. And that was the 90s C++, not the C++ of today. I dodged a bullet there.


Unfortunately I learned Delphi

Afterwards you could not take the other languages seriously

Like comparing two strings for equaltiy, strA and strB.

In Delphi, you write: strA = strB

In Java: strA != null && strA.equals(strB)

Delphi just did everything better


I tried to learn Delphi on an existing Delphi project.

My experience was one of hunting dependencies in bookshelves, file serves, (defunct) vendor web sites and also source forge.

That was the point were I grokked the immense value of Maven.


Java was designed when C and C++ were still going strong and there was a feeling (or fear, depending on who you asked) that C++ would be as omnipresent as C was.

Java tried very hard to fix the perceived errors of C++ and operator overloading was high on that list.

Nowadays, we are no longer afraid of operator overloading so I kind of wonder why it hasn't found its way into modern Java.


But they fixed the wrong "errors"

C++ is actually a good language. But everything that comes from C is bad.


There's a very good language in C++ trying to get out.

The problem is that different people consider different subsets of C++ as good.


C++: has generics, inheritance, pointers, macros, const, function overloading, and exceptions

Sun: C++ is too complicated. We need to simplify it by removing generics, pointers, macros, and const

Google: C++ is too complicated. We need to simplify it by removing generics, inheritance, pointers, macros, const, function overloading, and exceptions

Mozilla: C++ is too complicated. We need to simplify it by removing inheritance, function overloading and exceptions


You are ignoring that every one of that languages you're describing here have not only removed stuff but also implemented stuff differently.

Also, Sun said "manual memory management is dangerous" and history proved them right (granted, they were not the first to say so). Java also proved that a VM based language can be competitive performancewise with a compiled language. It influenced the design of PL down the lines.

Go, well I'm not the biggest fan of its design philosophy but I'm still would have chosen Go over C++ in the 90s if both were available back then.

Rust goes well beyond anything C++ has done. C++ failed in replacing C but Rust might be able to pull that off. Considering that we still have lots of the buffer overflows in 2021 I'd say it's about time.

> C++: has generics, inheritance, pointers, macros, const, function overloading, and exceptions

Pointers. Plural. That's a good point. C++ likes pointers, so much it has raw pointers, references, std::auto_ptr, std::unique_ptr and std::shared_ptr.

C++ also has a shitton of other functionality without a coherent design. In that regard, even C is better. They also almost never remove anything. That std::auto_ptr is up for removal just shows how bad it was and that it shouldn't have been added in the first place.


The same, except today, Python vs C/C++

Novice C programmers would get stumped on opening a file, reading and parsing the data.

Now you have:

    with open('foo') as reader:
      # blah blah


And to think, Java was a tough sell to companies at one time. I had to sneak it in (same way we snuck Linux in) by building some invisible infrastructure thing with it, having it run without fail for months, and then saying, "Oh hey, did you know thing X is actually Java/Linux?"


Java got it wrong IMO. There are many things that need the same management. C++ allows this vis destructors. You can auto-manage memory, auto manage locks, auto manage files, auto manage GPU resources, auto manage video players, audio players, etc.. etc ...

Java you can only auto-manage memory. All the rest you can't.

Yes I get that C++ has too many foot guns but Java's solution is half assed. There's so much more to resource management than just memory.


One other thing about Java is it had great libraries. C++ didn't have things like collections so you couldn't write a library that used a 3rd party linked list because your user might not have a roguewave license etc. STL became popular soon after Java which helped.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: