Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Coding Standard Nazis

Name: Anonymous 2015-02-15 10:59

http://wiki.wesnoth.org/CodingStandards

Do not use #define for constants
#define foo X is not a typesafe approach to define constants. Instead, you can something like the following (in an anonymous namespace) to achieve the same goal in a typesafe fashion.

Do not use C-style casts
The following code,
if(i->second.side() == (size_t)player_number_) {
is considered bad practice in C++ since a C-style cast is overpowered -- if types change around it could end up casting away constness, or performing an implementation-defined data reinterpretation (basically a C-style cast is a compiler-generated combination of static_cast, reinterpret_cast, and const_cast).

Name: Cudder !MhMRSATORI 2015-02-15 13:34

>>3
C++ is C with a bunch of extra stuff, most of which no one uses.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List