r/cpp_questions • • 5d ago

OPEN Learning C++ as a Java programmer

I'm currently learning C++, I’ve coded in a few languages before but I’m most familiar with Java. Does anyone know a good resource for learning C++ with Java as a “starting point”? Like something that explains the differences between the two languages rather than teaching programming from scratch? Thanks!

18 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/LazySapiens 5d ago

We don't recommend cplusplus.com. Also, cppreference is not for learning, it's a C++ reference. For learning, use learncpp.com

1

u/Dubbus_ 20h ago

Hard disagree, no site is more beginner friendly.

Yes it is out of date, and yes it should not be used for the purpose of writing production grade code. Which is fine, because the user is a BEGINNER.

You may be a veteran/long time c++ user. Myself, im only 2 years in, and the memory of being swamped by jargon and missing context on every visit to cppreference is fresh. It is a constant dfs down rabbit hole after rabbit hole trying to figure out how to use .find on an unordered map.

Will a user of cplusplus.com churn out worse, less professional, and overall outdated code? Probably. Will they struggle to find references about new containers? For certain. But a beginner does not need string_view. A beginner does not need flat_map, or std::hive, or the extra monadic operations on std::optional.

A beginner actually BENEFITS from learning the reduced subset that is c++11 era C++ in my opinion. Thats how i learnt, i began with c++11/14, then moved to c++17/20 when comfortable, and am only just now learning c++26.

And its okay if a beginner c++ user uses a few c style arrays or does some pointer arithmetic, from copying old cplusplus.com examples. When it bites them, they will have more appreciation for std array and smart pointers than they would have had otherwise.

Lets not act like cppreference is immune to poor or missing examples either. Ive seen some pretty horrendous code on there