Difference between revisions of "Coding Conventions"

Jump to navigation Jump to search
99 bytes added ,  19:01, 21 March 2010
→‎Language features: Mention that C++ global objects are bad
(→‎Language features: Mention that C++ global objects are bad)
Line 5: Line 5:


== Language features ==
== Language features ==
ScummVM is written in a subset of C++. Due to limitations of the C++ run-times on various platforms, the following features can't be used:
ScummVM is written in a subset of C++. Due to limitations of the C++ run-times on various platforms, the following features cannot be used:
* C++ exceptions (throw/catch)
* C++ exceptions (throw/catch)
* C++ RTTI (run-time type information, as in dynamic_cast<>)
* C++ RTTI (run-time type information, as in dynamic_cast<>)
* global C++ objects (their constructors / destructors will not be called on certain targets)


Furthermore, the standard C++ library is a big no-no. Besides usually heavily relying on the above mentioned features, it also sucks up rather more resources than we'd like to, so we have our own replacements for various container classes etc.
Furthermore, the standard C++ library is a big no-no. Besides usually heavily relying on the above mentioned features, it also sucks up rather more resources than we would like to, so we have our own replacements for various container classes etc.


We are reviewing these decisions from time to time, but so far, in our estimation the drawbacks of using any of these outweigh the hypothetical advantages.
We are reviewing these decisions from time to time, but so far, in our estimation the drawbacks of using any of these outweigh the hypothetical advantages.
1,079

edits

Navigation menu