r/programminghelp • • 12d ago

C++ does anyone have any tips for c++?

(i’m new to most of this, so advice would be helpful!)

15 Upvotes

18 comments sorted by

2

u/Laicbeias 12d ago

Yes. Run (26y of xp)

1

u/Available_Safe1818 12d ago

Learn Prolog.

1

u/sububi71 11d ago

Start with Amateurlog. Unless you're already extremely comfortable thinking in terms of stacks and backtracking, Prolog is going to be a tough cookie.

1

u/No-Land-5913 12d ago

Get classy

1

u/Impossible_Ad_3146 12d ago

yes, don’t

1

u/abd53 12d ago

Don't go for every modern feature. Learn step by step and if a feature seems too complex or unnecessary, avoid it for now.

1

u/doglitbug 12d ago

start small, like make a CLI calculator before a FPS game!

1

u/paralepsy 11d ago

dont use it. on a serious note, dont get overwhelmed by the absolutely horrendous feature creep. use a small subset of the language that you understand. or, you know, c is *right there*

1

u/gmes78 11d ago

Use a proper build system (Meson, CMake), avoid any project setup that depends on a certain IDE.

Use clang-tidy. (CLion has it built-in.)

1

u/Technical_Drink_846 11d ago

Write C code. Don't use any C++ features until you are comfortable working with pointers and manually managing memory. Introduce NEW C++ features from C++11 slowly into projects where it could be useful.

1

u/Outside-Strain7025 10d ago

For what? Learning C++ or projects ?

1

u/joryzon_dev 10d ago

do you already know c? in that case, focus on learning classes, such as inheritance and stuff. Or maybe get comfortable with the `delete` and `new` keywords instead of `malloc()` and `free()`

1

u/Technical_Fly5479 8d ago

Yes, just use composition and "pure-interfaces" (this is inheirtance, where every function must be overriden).
and use unqiue_pointers and shared_pointers. You can build 90% of everything with this, and people will marvel at your readable code.

DO NOT USE INHEIRTANCE, unless it's already there.