Expectations - Common Knowledge

This thread follows on from one of the posts in the thread "Expectations":

https://cplusplus.com/forum/lounge/285833/#msg1243095

seeplus wrote:
Although now dated (C++98) there is a C++ book called 'Common Knowledge'
https://www.amazon.co.uk/Common-Knowledge-Essential-Intermediate-Programming/dp/0321321928/ref=sr_1_1

Thanks for the pointer to this book, it sounds very interesting.

I do think the basic principles of C++ have not changed so much. Though there is plenty of new details and tools.

So what else counts as Common Knowledge?

So far:

General

* use RAII when possible
* always initialise variables
* pass non-built-in types by const reference when in-parameters
* use const correctness
* know how short-circuit evaluation works and use it to prevent unnecessary execution of code
* avoid the use of using namespace std
* use clear naming (including the single responsibility principle)
* format code neatly and consistently (including spaces around in-fix operators and keeping line lengths down to minimise scrolling when using debuggers or diff tools)

C++ standard library

* string/string_view
* stream i/o
* algorithms
* iterators
* containers (especially vector)
So what else counts as Common Knowledge?


This really depends upon how much detail you want to go into (eg structured bindings, owning/smart pointers, thread knowledge, design patterns [eg factory, bridge/pimpl, singleton] etc etc etc).
Another aspect of what else should count as common knowledge is what C++ standard one uses.

Modules (and import) for instance.

C++23 changed the landscape quite drastically with its import std; or import std.compat;

https://open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2465r1.pdf
Topic archived. No new replies allowed.