3
votes
How to prevent 'global variables' in a big project?
In the new bright world of C++ Core Guidelines (endorsed by no less than Bjarne Himself and current WG21 convener Herb Sutter) - there is Clang-tidy, and its avoid-non-const-global-variables option: ...
1
vote
Should I assume data passed to my function is accurate?
As designed, you cannot check in C that the string is properly initialised. The solution is to change things so the function called is responsible for everything. Don’t pass in a pointer that might be ...
1
vote
C/C++: Which conversion warnings make sense in practice?
Here's what decades of experience have taught me.
Turn on all the conversion warnings and tell the compiler to treat all warnings as errors.
The conversions that must happen should be made explicit ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
c × 1321c++ × 291
programming-languages × 75
design × 63
compiler × 60
pointers × 54
java × 53
coding-style × 53
embedded-systems × 47
memory × 46
data-structures × 45
multithreading × 40
linux × 40
programming-practices × 36
object-oriented × 35
python × 35
assembly × 33
algorithms × 30
libraries × 29
performance × 27
api-design × 25
architecture × 24
array × 24
design-patterns × 23
history × 23