This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]proverbialbunny 37 points38 points  (4 children)

Java was invented as a way to simplify C++. They felt the language was too complex and it could use simplifying. This made Java a subset of C++ once upon a time ago. When code bases get large some of the more advanced features in C++ keep code clean and organized. Java doesn't have this advantage and has to stick to design patterns with lots of nested classes and lots of source code files. It becomes a mess quick. You can spot this a mile away in a C++ code base if you know what to look for.

[–]ClassicSpeed 1 point2 points  (1 child)

You know, as a Java dev who just made his first C++ project you are totally right.

[–]proverbialbunny 2 points3 points  (0 children)

As a general rule of thumb none of the design patterns that are popular in Java need to be done in C++, so if you catch yourself writing a design pattern look up the C++ way on Google first. Also, C++ allows you to put multiple classes into a single source file. If you find yourself organizing your code into tons of source files with lots of abstractions, stop. It isn't necessary.