Java/C++ - Java code reusable C++ isn't? That meaning?

I hear a lot of people saying that C++ code isn't reusable… What exactly do they mean? I'm no C++ programmer… I even asked my friend who is a C++ programmer… But no knowledge of JAVA means he doesn't know… So can someone give me quick explanation?


That is an incredibly ambiguous statement… I can only try to understand what they mean!

IMHO What that statement tries to address is the fact that Java compiles to .class files that you can dynamically use as part of your program without having to create a special library, while if you have a .o file from C/C++, you would have to link and recompile your program against that file.

If the statement is focusing more on metaphysical and/or philosophical features of modularization and OOP, then I would say, stop listening to whoever is saying that. Code is reusable by design, not by language.

okay thanks

in the last 10 years of coding, i've NEVER, i repeat, NEVER seen a single piece of code that was properly reusable if the author did not plan it to be used in the way it has been.

I would argue that Java has a tendency to force you towards OOP while C++ is a little more forgiving.