4 ms·
Preshing is a smart guy but this seems to miss the point in a way typical of C++ devs. Python—as with other languages—isn't just a list of features. It also has
by nhaliday 10y ago
Preshing is a smart guy but this seems to miss the point in a way typical of C++ devs. Python—as with other languages—isn't just a list of features. It also has a guiding philosophy (made explicit in Python's case in https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/).
C++ doesn't seem to have a guiding philosophy besides "be a Swiss army knife backwards compatible with C." That's OK but I would argue it prevents C++ from every being "Pythonic."
- pjmlp 10y agoThere are many cultures inside C++, but they basically spit into two. There is the one that appreciates C++'s abstraction capabilities with ability to go low level when needed. Cares about writing safe code and sees C copy-paste compatibility as a compromise required to get C++ adopted by the industry. Those developers usually appreciate languages like Ada, Modula-3 and Haskell, and would rather kill the pre-processor. Then there is the culture that somehow had to move from a C compiler into a C++ one, constrain themselves to the C subset of C++ while ignoring the standard library because bloat and write exploit sensitive code as always did in C. Many on the second culture tend to do micro-benchmark driven development. Each code line is questioned how much fast and memory it takes by gut feeling, without any regard from profiler tools or actual needs from the application users.
- santaclaus 10y ago> That's OK but I would argue it prevents C++ from every being "Pythonic." This got me thinking, what would one call an idiomatic C++ style (which I suppose is part of what the core guidelines are trying to push)? Cppthonic? Bjarnic? Python is 'Pythonic,' I usually hear idiomatic Ruby described as the 'Ruby Way.' Is idiomatic Rust 'Rustic'?
- fauigerzigerk 10y agoIf there is one guiding philosophy that C++ has it's abstraction without runtime cost. The (implied) corollary is that compile time cost, mental cost and social cost of language features do not matter. As long as there is at least one person on the planet who really understands the ins and outs of a language feature, that is sufficient proof of the language being simple enough. There is no need for anyone to understand the entire language.
- nhaliday 10y agoThat's fair but Rust has the same primary design goal and yet I find programming in it more ergonomic (despite Rust having a cranky borrow-checker that C++ lacks). I don't know how much of that is due to C++'s historical baggage and how much is due to a greater concern for usability and elegance on the Rust side, with consequent discretion when adding new features. But I don't think it's entirely the former.
- sklogic 10y agoC++ got a much stricter guiding philosophy than the Python zen. This is it: "you should never pay for the features you do not use". The entire language is built with this guiding principle in mind.
- vardump 10y agoRight, but pretty often the payment is not obvious. For example, it's often shocking how many non-obvious wasteful copies are being made behind the scenes as output to relatively innocent looking code. That's of course "programmer's fault", not denying that. So you end up paying for things you didn't intend to use, but used anyways because of some small detail. Sometimes I feel like the only way to write good C++ is to keep looking at the disassembler output... C++ is my dayjob.