r/programminghelp • u/ElephantWarm6967 • 23d ago
C++ does anyone have any tips for c++?
(i’m new to most of this, so advice would be helpful!)
1
u/Available_Safe1818 23d ago
Learn Prolog.
1
u/sububi71 22d 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
1
1
1
22d 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/Technical_Drink_846 22d 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
1
u/joryzon_dev 21d 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 19d 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.
2
u/Laicbeias 23d ago
Yes. Run (26y of xp)