Why does scummvm not use stl?
Moderator: ScummVM Team
Why does scummvm not use stl?
While taking a look at the source I noticed that rather than just using the STL scummvm developers have gone on reinventing the wheel. What's the reason behind this?
There are several reasons for that.
First, STL is not that portable and does not exist on all ports we support. Then, even when it is ported on a platform, it is a monster code-wise, take some of the smaller device ports into account. And that's why instead of reinventing the wheel our implementations are quite lightweight.
Eugene
PS. In fact, this question better fits scummvm-devel.
First, STL is not that portable and does not exist on all ports we support. Then, even when it is ported on a platform, it is a monster code-wise, take some of the smaller device ports into account. And that's why instead of reinventing the wheel our implementations are quite lightweight.
Eugene
PS. In fact, this question better fits scummvm-devel.
When I was a young boy new to ScummVM, I tried to convince people to use STL (or even the full standard C++ lib, too). But as Sev pointed out, it has some severe drawbacks: It has a lot of overhead in terms of binary size (which is very important on e.g. Nintendo DS, were we are happy for every KB we can save); in terms of memory usage; (our String class has less features than std::string, but it also takes far less memory on the heap); and our code works on all of the dozens of platforms and compilers ScummVM runs on, while the STL is not available everywhere, and sometimes only varying subsets are available.
Therefore, we chose to "reinvent the wheel", if that's what you want to call it (though String classes, simple linked lists etc. are such simple and fundamental data structures taught in every "Programming 101" class, that I would rather call it a "simple exercise"
. Although the performance / memory tuning isn't always... 
Therefore, we chose to "reinvent the wheel", if that's what you want to call it (though String classes, simple linked lists etc. are such simple and fundamental data structures taught in every "Programming 101" class, that I would rather call it a "simple exercise"

