Jaydip
Diamond Member
I've never encountered any problems with Java's memory management. If you work with the minimum scope possible the GC works great. But, the OP would be able to learn a new language by the time he starts to encounter memory management issues...lol
Java has one of the best GCs in the business (Ok, Since there are multiple JVMs, I should say Oracle and the OpenJDK which I believe use the same GC algorithms). Pretty much every other GC is trying to copy what Java does (Love or hate Java, the JVM is really a pretty impressive piece of tech).
Honestly, The only languages that might do GC better are the functional languages, but that is more because they have vastly simple data models (Immutability makes things so much easier to deal with).
Depending on the use case, a GC language can often best a managed language in terms of memory allocation and freeing speed. In C and C++, if you are doing a ton of heap allocations, you end up needing something like a memory pool to keep from bogging down the program.
Where GC languages often suffer is memory consumption. However, we are in the day and age where phones have 2gb of ram often used for single applications... I think we can survive if my java app consumes 64mb of memory (even though the C++ version would get away with 1mb).
Sure, if you want to target an embedded system with 2mb of ram, then you are stuck learning C or C++. But we aren't talking about learning embedded programming, we are talking about just learning programming.
But, like I said, debating over "which language is best for beginners" is pointless to me. The programming language is pretty minor when it comes to learning how to program. Someone could start by learning COBOL and still end up being a decent programmer.
I agree, we are really going in circles here.Choose one and learn it by heart.