Quote: I do have to say, there is only one AAA game company that I've heard of using the STL. Every other one I've ever encountered and heard say anything on the topic says not to use them.
|
Irrelevant, for many reasons. First, the "STL" (technically the term you want is the SC++L, and that's what I'll be using from here on out, to avoid confusion) is part of the language itself, and as such "understanding the language" perforce includes "understanding the SC++L," its standard library. That isn't to say that you cannot use the language functionally without it -- you can. But you're not using the language fully.
Second, the reasons that many studios have for avoiding the SC++L -- and there exist multiple good reasons -- are varied and likely very different from what you expect. I'll touch on this later when I address Xienen's points.
Quote: STLs are great for business application implementations that don't have to worry about performance.
|
They're also great for games. The SC++L is not slow, it is an extremely well-written, extensively-tested, vetted standard library with exceptional general purpose performance characteristics on most platforms. Yes, there are platforms where it is poorly implemented (many, especially older, consoles for example). Yes, if you know the specific domain very well you can sometimes outperform it for specific scenarios. That doesn't make a blanket statement like the one I quoted correct or reasonable.
Quote: I'm sorry, if this happens a lot with you then you're not a good coder. Plus, that's technically how polymorphism works well AND in order to use the casts you said you need run-time-type-info enabled which is SO INCREDIBLY SLOW. If you're doing rtti casts which graphics/mesh/animation data then you've destroyed it.
|
You're right; good programmers will use the tools at hand to avoid having to write such error prone code. Those tools include the SC++L. It's irrelevant that that's "how polymorphism works," (regardless of the questionable accuracy of that overly general statement), because that is handled for you automatically by the toolchain. Much like how the SC++L allows the library to automatically handle things for you. But you're not advocating for manual polymorphism are you? Finally, RTTI is not appreciably slow. It's cost is in the extra memory usage, which can translate into more subtle performance issues like cache coherency, but it's not a massive speed sink on its own. dynamic_cast, however, is slower than other casts because (as you correctly try to point out) it requires RTTI and does checks at runtime. That is the nature of the operation, however. Fortunately the need for dynamic_cast can usually be avoided with better designs.
Quote: Good code isn't about using other people's libraries well so that you don't have to think, it's about making your own.
|
That's insane. There are merits to both using existing code and libraries and rolling your own, and it's rarely so cut and dried. The capability to make the decision to buy or build is vastly more important than the ability do either. Middleware and libraries play a very important role in getting software developed on time and under budget. Discount that at your peril.
Quote: Don't talk about my tone young man.
|
Watch your attitude.
Quote: No, I guarantee it's just you. Compiling under debug scenarios often causes most compilers to throw inline out of the window. Noting that the STL often connects several functions together to do something basic DESTROYS performance. Say, for example you have a vector representing vertices, you are processing the vertices or particles every frame, you can imagine that taking every access on those particles out of inline would slow it down. If you're NOT getting a slowdown then what you're doing IS trivial or you don't know what debug compiling is.
|
You made the claim, the onus is on you to provide the benchmarks that back it up. Do so, or drop this line of argument. It will only turn into a bickerfest and I
will lock the thread and issue judgement on all parties concerned in that case. That goes for everybody: this subject is taboo until we get real metrics.
Quote: Ok, I'm sure the Nintendo DS is ALL about string stls. I'm sure they expect the programmers who work on it to be incompetent. Also, the XBOX 360: Sure you can compile the stl and get it to work on there but it's just silly noting that you're trying to squeeze performance out of it.
|
This is a bogus argument.
Quote: I stand corrected. I am obviously not as familiar with the STL as I once was, I thought deques, queues, and stacks use a linked-list style architecture, not an dealloc, realloc, and copy architecture. I will have to update our policy on data management if we are looking for another graphics/engine programmer in the future. Thank you Mike.
|
deque, vector and string (which is, unfortunately, technically a container) are generally the most efficient general purpose containers in the SC++L.
Quote: While I understand that it is generally considered to be a minimal trade off in game development, we believe that low level data management within an engine must be tight, precise, and all data must be constantly accounted for. If there is a memory leak at such a low level in the engine, then that's a problem with the programmer(s). At such a low level, we are unwavering in our desire for the most efficient code possible(especially in memory utilization when working on consoles). |
And that is understandable, but blanket statements like "SC++ IS TEH EVIL" (yes, I am hyperbolizing, I know) aren't helpful to anybody.
That said, I mentioned there are reasons to avoid the SC++L, and that's true. I suspect the majority of studios avoid the SC++L due to an ingrained distrust, such as Xienan has/had, that comes about from the days when it was less viable for general purpose performance -- back in the days when compilers really, really sucked at templates, et cetera. But things have improved a lot since then. There are other reasons, more valid: most studios work off a large corpus of existing legacy code, code that was written when the SC++L wasn't a good option, or whatever. That code typically has a bunch of hand-rolled containers, etc already in place, and for that code those libraries fill the role of the SC++L. Tested, general purpose, fast. Refactoring that code to use the SC++L is probably pointless.
But when those studios go to make new projects, they use that existing code, they don't rewrite their array classes. And contrary to what StephenTC thinks, it does
not take two hours to develop container/string/utility classes on par with the quality of the SC++L or those analogous internal libraries that have had man-years of maintained.
In fact, that statement is one of the most telling about your opinion on the craft, StephenTC, and one of the things I would strive to rectify the most about yourself. A good programmer, a good software developer, should seek to improve his or herself in all ways, at all times, through the pursuit of new and updated knowledge. Those are the kind of people
I want to hire, not people who subscribe to zealous dogma without admitting to the possibility that things will change and there is rarely such a thing as a true blanket statement.