8

There's a lot of good idioms promoted in modern C++. These include RAII and elegant use of boost or STL or a std::algorithm to solve a given problem.

Just like you can write C in any language, you can certainly write C in C++. However you can write really good modern C++ code with the right subset of features. When someone does something really cool with an STL or boost construct I always get the urge to call it "pythonic" in the sense that its the canocical elegant way to do something. Is there a term like how "pythonic" is used in python to refer to C++ code written in the modern style with modern idioms?

10
  • 11
    How about bjarnic? – Job May 3 '11 at 14:35
  • 20
    Anything wrong with "idiomatic C++ code"? – user7043 May 3 '11 at 14:39
  • 3
    "Idiomatic" as in a idiom native to the language. – dietbuddha May 3 '11 at 14:43
  • 4
    @OptimizePrime, when I hear code described as 1337, I get nervous that its probably too clever :) – Doug T. May 3 '11 at 16:08
  • 1
    @OptimizePrime That would be rather contraproductive, as professionality and cleverness are the last terms I would associate with someone speaking leetspeak. – Christian Rau Sep 19 '11 at 11:08
13

I usually call it "modern C++" and most people get what I mean by that.

3
  • 7
    Maybe for c++0x we should invent a new term, we can say the code r0x. – Doug T. May 3 '11 at 16:09
  • 2
    and mostly they run away, screaming? – Carson63000 May 3 '11 at 21:27
  • "most people think they get what I think I mean by that" – Paul Draper Oct 18 '15 at 19:46
6

"Modern C++" as Nemanja Trifunovic already answered is well used, but the generic adjective for all languages is "idiomatic". So for C++ it would be "idiomatic C++". "Pythonic way" is the same as "idiomatic Python".

4

Nice question. Some of it seems to be covered by idiomatic as a more general version of pythonic; often generic code fits your requirements for modern C++ in practice.

Especially as opposed to this C-style of code, I also often call that good code simply "C++" ;)

-4

'Slick' is a term I've used and heard for many years to describe clever, concise, well written code - from before Python was invented.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.