this post was submitted on 23 Aug 2023
16 points (100.0% liked)

C++

1755 readers
1 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 year ago (2 children)

These have kind of been the bane of my existence. I'm an old C programmer who luckily stumbled into a primarily C++ role after being stuck doing web frontend for way too long, but the language we're using is not the language I once learned and it's hard to teach an old dog new tricks. I hope the younger guys don't get fed up with correcting my screw ups in code reviews. Like, during an interview question I was asked "why didn't you use smart pointers instead of manually allocating memory?" And I just had to go "C++ has smart pointers now?"

I feel like such a dinosaur. Maybe I should just go find a COBOL maintenance job.

[–] lysdexic 7 points 1 year ago* (last edited 1 year ago)

Smart pointers were introduced over a decade ago, and since their introduction there were already four updates to the C++ standard. There is really no excuse to shy away from smart pointers at this point. I really recommend you get up to speed on them.

[–] coltorl 2 points 1 year ago

Switch to an IDE that has clang-tidy. Enable as many warnings as you can stomach here https://clang.llvm.org/extra/clang-tidy/checks/list.html

You don’t have to be reading the standards doc to keep up with the new constructs. As long as you keep up with tooling, you should be getting warnings and recommendations that teach you about the new constructs.

[–] aport 2 points 1 year ago* (last edited 1 year ago)

My favorite guideline is

???

Rationale: ???

Enforcement: ???