-
Notifications
You must be signed in to change notification settings - Fork 163
Coding Style and C Language Features
A coding style or formatting style generally refers to the organization, placement, and tab and brace formatting practices. That is, things that have no impact on the logical interpretation of the code and is only visual. You can get a more in-depth definition on wikipedia
Currently there is no universal coding style enforced across the FSO codebase, but we do recommend that if you make changes in an existing file the existing style should be kept.
We currently have a minimum target of VS 2015 so the used C++ features should be available in that version. At the moment we have no hard limits on what GCC or clang version needs to be supported though.
This means that all of C++11 and a decent amount of C++14 can be used.
RTTI may be used to dynamically query the type of an object at runtime
All new code should use a comparison with nullptr
instead of NULL
(or treating the pointer as a boolean); in other words, if (ptr != nullptr)
is preferred to if (ptr != NULL)
or if (ptr)
.