3 ms·
Even an article as shallow as this raises some red flags about the code base: * A common base class is rarely a good pattern in C++. Such classes have a tenden
by microtherion 9y ago
Even an article as shallow as this raises some red flags about the code base:
* A common base class is rarely a good pattern in C++. Such classes have a tendency to bloat.
* A custom string implementation is a cliché for new C++ adopters. Everybody thinks they need to reimplement std::string. Most are wrong.
* The code as shown separates declaration and initialization of local variables, which decreases readability and safety of the code.
- ttul 9y agoYeah, not sure why the author was praising the excellent library and string class. That’s what std provides. Why reinvent the wheel?
- rob23 9y agoBecause the year is 2000-2002 and you are embarking on writing a game engine targeting PC, Mac, Xbox, Playstation, and any other consoles or platforms that come onto the market before your engine is finished. Compilers and standards compliance was a shit show. Things like EA-STL might look silly nowadays, but there are many great reasons why companies rolled their own stuff back in the day.
- AstralStorm 9y agoEven now STL is not perfect for realtime and threaded programming. Thus comes from outdated and schizophrenic approach to memory management. It is getting fixed but that will take years and multiple revisions of standard. Let's start with lack of immutable objects, continue with missing support for pmr or allocators and finish with hidden default heap allocations in algorithms and data structures. (Including some smart pointers.)
- ttul 9y ago#schooled