Lurker News
In the recent years C++ received a lot of backlash due to its complexity and (perceived) feature creep. However, since C++11 I really enjoyed writing C++ with its strict type system (including const), range-based for loops, smart pointers, and how much you can do with templates. On the other hand, I know that it can be very tricky to write, for instance, a correct iterator, to get handling of rvalue references right, or to read error messages that involve templates.

So, do you enjoy or dislike writing C++ source code and why?

Comments (93) 66 threads

Earlier comments
Panzerschrek#
Modern C++ is nice to use, except cases where stupid mistakes caused by its heritage can be made (like returning std::string_view to a temporary string).
NooneAtAll53 replies#
I still don't understand the "feature creep" complaint

python just introduced built-in sentinel, and only comment on an explainer video brought up that it's nothing new and is just a rename of unittest.mock.sentinel
who even knew there's unittest module? who even knew there's unittest.mock? definitely not me
because it doesn't matter - you use what you need and learn what you encounter. Same thing with C++

NooneAtAll5#
also "do you still enjoy X" is a loaded question

do you still enjoy speaking english?

quietbritishjim#
There's a big difference between a function or class that you didn't know about (or has just been added to the standard library) vs a new language feature.

Python isn't immune from those either by the way (e.g. walrus operator, pattern matching) but nowhere near C++ level.

optionalsquid#
While I agree that the Python standard library contains a lot of stuff, I am surprised that you have never heard of the unittest module. Sure, pytest is a very popular replacement, but its documentation frequently refers back to unittest, and the unittest module is also one of the top hits if you search for "python testing".

It has also been in there since Python 2.1, as far as I can tell [1], though the mock module is somewhat newer [2], but still quite old at this point. In all that time, have you never skimmed through the list of modules in the standard library? I'd recommend doing so once in a while, since a lot of the stuff in there is quite useful: https://docs.python.org/3/library/
[1] https://docs.python.org/2/library/unittest.html [2] https://docs.python.org/3/library/unittest.mock.html

mococa#
Yes. It was my first language (which I started to produce something useful, got jobs, etc...) - and it will be my last.
dekdrop#
Recently I have started to learn C++. It feels nicer than C at first, while remaining in more C like. But moving to more C++ feature doesn't feel good. I heard many others use C++ just for some extra feature on top of C and leave many features out, like not writing classes. I like that way too.

Load more comments