3 ms·
Try not to read condescension into things so easily. Eg I'm pretty sure that the line you quote, > Don't use anything from STL that allocates memory, unless yo
by skrebbel 6y ago
Try not to read condescension into things so easily. Eg I'm pretty sure that the line you quote,
> Don't use anything from STL that allocates memory, unless you don't care about memory management.
is not meant condescending but literally. Ergo, if you don't care about memory management (which is fine), then feel free to use lots of STL stuff.
Case in point: for lots of embedded software, memory matters a lot and it's important that it's obvious to the reader of the code what memory gets allocated where. The STL classes you quote make this harder to see. But if you have lots of RAM anyway (ie "you don't care about memory management") then this does not matter much.
A key goal of this list appears to be, I quote, "Projects written in Orthodox C++ subset will be more acceptable by other C++ projects". This particular guideline makes it more likely for your code to be deemed acceptable by embedded programmers so it seems to fit. I don't think it was intended to be condescending in any way. I think the same holds for the other points.
It could've definitely been written a bit clearer though.
- MauranKilom 6y ago> Try not to read condescension into things so easily. If they didn't intend condescension, they should not have put a comic displaying exactly that (and with essentially no further relevance) into the middle of the article.
- joshuamorton 6y agoI don't think that's what they mean when they say condescending. On the other hand, > Don't use metaprogramming excessively for academic masturbation. Use it in moderation, only where necessary, and where it reduces code complexity. Is definitely condescending (and I say this as someone who is terrified of writing any kind of templating whatsoever).
- fooker 6y ago>Ergo, if you don't care about memory management (which is fine), then feel free to use lots of STL stuff. This isn't really true. All of these containers take custom allocators, which can be tailored to your use case (eg: a stack based allocator).
- asdfasgasdgasdg 6y ago> is not meant condescending but literally. Ergo, if you don't care about memory management (which is fine), then feel free to use lots of STL stuff. I don't see it that way. Plenty of people care about memory management and also see the STL as a fine tool to use. Little is gained from a memory management perspective by avoiding e.g. std::vector. Whether condescension is intended or not, this definitely comes across as talking down to me, and worse, it is incorrect.
- erik_seaberg 6y agoI don't think "more acceptable by other C++ projects" works out well. If I don't appreciate how RAII and exceptions clarify normal control flow, I won't write code that avoids leaking when its dependencies throw. This poisons any project it spreads to. Google famously had to abandon any hope of using exceptions because of a critical mass of flawed legacy code.