by std_throwaway · 9y ago · 0 comments
What is the equivalent term or expression for being in the spirit of C++?
The article, while a joke (just like C++ originally, look it up), feels very C++y.
Idiomatic might be fuzzy, but it definitely does not include active attempts obfuscation, malice or jokes. The code in the article could be any of these depending on context.
An example of non-idiomatic C++ might be
for (int I = 0; I < c.size(); I++) {
Total += c[I].foo;
}
...instead of using std::accumulate. The code from the article is (humorously pointing out) something else entirely.Not so much with C++. There is no one way to do things. Depending on your needs, you will use the language differently. Code focused on performance (ex: game engine) will look very different from server code, or a GUI, or embedded software. And none will be more C++y than the other.