[General] Java vs C++

Well, I've been learning C++ lately, So I know what's it's like. C++ is more complicated. It depends on how fast you learn. I learned in 3 months because of the similar lanuages of c++ like PHP. It looks a bit similar to me I guess like their functions and else if. So i'd say that Java is much more easier since C++ is for hardcore games :P
 
It depends on how fast you learn. I learned in 3 months because of the similar lanuages of c++ like PHP.

Lol, then what are mutable variables in classes? What's the Pimpl-idiom? What is a heterogeneous array? Why should you avoid macro's? What does a dynamic_cast do more then just a regular C cast?

I'm sure you're not even half way to knowing C++ ^^, unless you program 24/7 hehe.
 
i've been studying C++ for 11 months and I would still consider myself quite
"inexperienced" in the field.

C++ is the most industry standard language. Even though I have seen company's looking
for C# programmers a lot lately (for server side development)

Java is more used for small time applications (such as mobile games) rather
than grand scale projects. Java support OpenGL as well as Direct X.

The fact that garbage collection is not up to programmer in Java, hurts it
more than it helps. While it does make life easier for the programmer. It
slows down your program and (at rare times) leads to some nasty bugs in
the program

Take a look at Employment areas for Software Engineers

EA Sports
Blizzard
Bethesda Softworks
Bungie

What do you notice in all of these ? they all require that you have extensive
knowledge of C++. There's bound to be changes in the future in where
framework languages will get more recognition into the game industry.

Languages such as Java and C# are still fairly new compared to C/C++.
And in the end it's really all about preference. In my opinion nothing could
ever be too complicated for the human mind and grasping something
as C/C++ is far from impossible.

If you really love programming than you will go to any means to learn what
you love to do. Even if it does mean learning something difficult.
 
Last edited:
I personally use Java more, but I have a great deal of knowledge in C and C++ (I still like null terminated strings and the cstring library over C++'s strings though), and besides, Java can be decompiled, so it's basically entirely open source. There is no reverse engineering with Java.

Daevius said:
Lol, then what are mutable variables in classes? What's the Pimpl-idiom? What is a heterogeneous array? Why should you avoid macro's? What does a dynamic_cast do more then just a regular C cast?

For humor:
1. Variables that aren't immutable.
2. Variables that aren't transparent. (Their technical name.)
3. An array that isn't all messy with its memory.
4. God created the preprocessor at the same time as Satan.
5. A dynamic cast bends, so it's good for fingers, a static cast doesn't, so it's good for long bones.
 
A language like C/C++ is great if you want maximum control over your program. It works on multiple platforms and is extremely powerful. However, it also has a high learning curve and has lower productivity than other languages.

Java is an excellent choice if you're extremely concerned about targeting multiple platforms. However, Java is slower than other languages but will provide you with higher productivity than something like C/C++ and many people are familiar with it.
 
A language like C/C++ is great if you want maximum control over your program. It works on multiple platforms and is extremely powerful. However, it also has a high learning curve and has lower productivity than other languages.

Java is an excellent choice if you're extremely concerned about targeting multiple platforms.
I agree completely with you here.

However, Java is slower than other languages but will provide you with higher productivity than something like C/C++ and many people are familiar with it.
In all fairness, the performance difference between JAVA and C/C++ really isn't that big anymore. Yes, in the 'bad old days' the memory limit, slow interpreter and a few other factors made it considerably slower than lower level languages, but these days you'll hardly see the difference.

In addition, you can easily compile JAVA into platform-specific bytecode, just as you would with C/C++. You shouldn't, generally, since the whole point of JAVA is that it works on pretty much anything without the need for recompilation, but it does provide a performance boost and negates the need for a seperate interpreter. Most of you know (or should know) the Eclipse IDE - guess what, that's 100% compiled JAVA.

Simple fact of the matter is that I just don't like C++. It's too much of a bunch of C functions with an OOP layer slapped on top, all grown together in some horrible mess. It takes years to fully master, and when you do most of what you write can be done faster and neater in a different language - like JAVA or C#. Not to mention those languages actually have excelent manuals and a large library of build in classes, ready to use.
 
Most of you know (or should know) the Eclipse IDE - guess what, that's 100% compiled JAVA.

And have you ever used it? It's sluggish as **** and horrible.

Every large scale application written in Java that I've EVER used has been horribly slow.

The "speed" difference is immense, unlike what you indicate, and it's more to realistic real-world examples.

Code ANYTHING YOU WANT in java and I'll make a C++ version that is *MUCH* faster. Nobody takes me up on this challenge because it's a guaranteed loss.

And further, the very fact that it has all those pre-built classes is what leads to why java is so detrimental to a developer. It teaches you to rely on **** other people have made rather than think for yourself. Look at an analogy in cooking: would you rather be a world renowned chef, creating your own things or some fucking two-bit cook working in some chain restaurant following a recipe?

C++ is not a difficult language. All of the competent and well-rounded developers I've ever met have been extremely capable of learning it or already knew it. I met someone who coded in VB when I met him but could reverse engineer quite well, now he's likely better than most other people I know at C++. If it's too difficult for you, you might want to consider an occupation or hobby other than programming.

As far as a manual is concerned, get a copy of the ISO standard and read it, learn it, know it. This type of formal comprehension of the language is above and beyond what most C++ developers achieve, but spend a few minutes reading it and you'll see why :). You think it's a super complex language with a seemingly marshal law in how it's handled, well it actually conforms to a very well defined rule-set. And Bjarne's book is the C++ bible, if you need something a tad more readable.
 
Eclipse starts up faster here than UltraEdit or Visual Studio. So yes, I have used it and yes, it is comparatively fast. And yes, I have a few good books here on C++ (The Language C and The C++ Anotations, both by F. Brokken. Guess what, I actually followed two courses in C/C++ from that guy - and aced both - but that doesn't mean I like the language). Trouble is, those are valid for just about one version of the language and are books. Fine if you have never had anything better, but just take a look at the online documentation offered by JAVA and C# and you'll see how much more it can be.

In fact, just try JAVA for a change, you'll see what a real OOP language is like. And from experience I can tell you that most prebuild libraries are better than what your average programmer can come up with. They are better tested, better worked out, and not build with a minimum of functionality due to a pending deadline (if you ever had a job as a programmer you know what I am talking about). To keep in the analogy: do you really want to grow your own vegetables, work on a farm for a year or two, care for them, slaughter your own cow, etc etc, or do you want to actually make something?
 
Eclipse starts up faster here than UltraEdit or Visual Studio. So yes, I have used it and yes, it is comparatively fast. And yes, I have a few good books here on C++ (The Language C and The C++ Anotations, both by F. Brokken. Guess what, I actually followed two courses in C/C++ from that guy - and aced both - but that doesn't mean I like the language). Trouble is, those are valid for just about one version of the language and are books. Fine if you have never had anything better, but just take a look at the online documentation offered by JAVA and C# and you'll see how much more it can be.

In fact, just try JAVA for a change, you'll see what a real OOP language is like. And from experience I can tell you that most prebuild libraries are better than what your average programmer can come up with. They are better tested, better worked out, and not build with a minimum of functionality due to a pending deadline (if you ever had a job as a programmer you know what I am talking about). To keep in the analogy: do you really want to grow your own vegetables, work on a farm for a year or two, care for them, slaughter your own cow, etc etc, or do you want to actually make something?

Eclipse actually starts far slower than VS. That's not even a competition, lol.

And I've used Java and C# plenty, their documentation is fine just as is the documentation in C++ (http://www.cppreference.com/wiki/, http://www.cplusplus.com/reference/, http://www.sgi.com/tech/stl/index.html, and documentation for language features and libraries in various locations).

The only problem there is that Java and C# provide basic, generic, and often inadequate interfaces to objects with less control than may be needed for many operations. These classes aren't better than MOST people could make, they're simply extremely basic, and in a lot of cases (look at the URL stuff for instance, and in fact any networking.. nio is just laughable, you need a custom library in Java no less to achieve the kind of power you can get with iocp/kqueue/epoll) lack A HUGE amount of functionality that otherwise must be re-implemented by a programmer, thus making them completely and totally redundant.

The reason people write partial classes in applications (esp. in C++) is because you don't need 55 extra features in a class which you will never use. You write what you need, and that's it. If you re-use the class later in another project, you may add a few functions here and there to add functionality WHICH YOU ACTUALLY NEED. Having 50% of your library or code be unused is a total waste of time and resources. In any case, you cling so desperately to your java class base but do realize that there are FAR more libraries readily available to any C++ programmer with far more use and maturity with MUCH more power and fine control for EVERY SINGLE THING that java can do, and even cross-platform. Your argument is null and void, as these libraries are much faster and provide just as good a documentation. For those writing RAD and wanting to get a product done QUICKLY by re-using existing libraries (like Javatards who think that you need an existing JDK class for everything or it's bad design or something like that) can do so just as quickly. I've never met a Java programmer who could develop something more rapidly than a competent C++ programmer can. Never. I've seen programming competitions where you have the benefit of a rich JDK and all C++ programmers get is the STL (not even boost or any other devel library which SHOULD put you at a *HUGE* disadvantage).. where the winners CONSISTENTLY always use C++. Why is it if you have such a goddamn HUGE lead in power in this MASSIVE library of unnecessary, retarded collection of classes to do basic things that you consistently LOSE competitions where development speed is THE SOLE FACTOR in deciding who wins? Just look at TopCoder, lol. Java makes things more accessible to noobs, C++ gives real programmers the power they need to get things done.
 
Last edited:
And I too agree with FragFrog. I own numerous books as a result of my schooling, and the gap between Java and C++ grows closer with time. I admit as an industry we are still using C++, but Java is getting better.

If you really want to go there writing a program to be so extremely fast, why not just use Assembler instead? Java has its strong and weak points, as does C and Assembler.

But you do have valid points about Java's complete overkill.
 
Last edited:
Eclipse actually starts far slower than VS. That's not even a competition, lol.

VS will take about 3 seconds to load for me (if my cpu is not under stress because of the background programs) - Eclipse will take me about 10 seconds to start up (like with VS, it will start slower if my cpu is stressed by background programs). So no, there is definitely no competition here.
 
Java multiple platform? Depends on the interpreter. I've heard some platforms have a horrible interpreter, and if you have an unpopular platform, don't recon Java can be run there. Instead, those platforms almost always support C and often C++ runtime libraries.

Also, I generally have bad experience with Java apps...OpenOffice, sometimes it just crashes and it's overall not a lightning fast application...but that might be the program, not the runtime libraries / language of course.
 
Back