The C++ Container Orthogonality Joke
I got a complaint that std::list is slower than std::vector. In that case, simply do `#define list vector`. But remember to test first and avoid premature optimisations!This is the beauty of the orthogonality in stl, you can often swap out containers just like that. Item 2: When you have a list of elements, prefer std::list. "vector" is a mathematical concept, and std::vector should only be used for those. This leads to more expressive, domain driven code! #cplusplus #cpp #affectivecpp
A screenshot shows a humorous C++ programming post suggesting redefining `list` as `vector` to solve a performance complaint, followed by a contradictory post recommending std::list for lists and std::vector only for mathematical vectors. The joke mocks contradictory programming advice, overconfident abstractions, and premature optimization. EN: A screenshot shows a humorous C++ programming post suggesting redefining `list` as `vector` to solve a performance complaint, followed by a contradictory post recommending std::list for lists and std::vector only for mathematical vectors. The joke mocks contradictory programming advice, overconfident abstractions, and premature optimization.
programming code / программный кодC++ source code / исходный код C++social media post / публикация в соцсетиblack background / чёрный фонwhite text / белый текстcode formatting / форматирование кодаhashtags / хэштегиlist container / контейнер спискаvector container / контейнер вектораmathematical vector / математический векторtext screenshot / скриншот текста
- @ithueti / 415 2018-09-24
- @right_wing_dev_squads / 5100 2022-10-14
- Type
- image
- Size
- 720×609 · 69.9 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added