3 ms·
I have been programming in C++ for almost 17 years now and I would say I know maybe 20-25% at most. The reality of C++ is you know what is needed for the probl
by satysin 10y ago
I have been programming in C++ for almost 17 years now and I would say I know maybe 20-25% at most.
The reality of C++ is you know what is needed for the problem you need to solve. As people mostly work in the same (broad) areas for their day to day work it is unlikely you need to know outside of that scope regularly. At least not in my personal experience.
Also I strongly believe nobody truly understands C++ streams :)
- blub 10y agoWhat are the components of C++ that add up to 100%? I can count: * language basics (variables, structural statements, functions, error handling, preprocessor, how compilation works) * OOP * functional programming (which is not that complicated at all in C++) * generic programming * advanced generic programming and metaprogramming * the C standard library * the C++ standard library basics (containers, algorithms, smart pointers, cout << "foo") * more advanced c++ standard library (maths stuff, threading(?), chrono, advanced streams (not needed)) I think most C++ programmers have a reasonable command of all of these except the metaprogramming and advanced standard library.
- satysin 10y agoYou just proved my point ;)
- blub 10y agoDoubtful. What would 25% of the above list be, basics + OOP? No standard library at all? No templated code? I am saying one can barely write programs by knowing just 25% of C++, let alone for almost two decades. On the contrary, I think 80%+ of the language is accessible to every programmer.
- AlexandrB 10y ago> On the contrary, I think 80%+ of the language is accessible to every programmer. 80% of the language looks accessible to every programmer. Until you hit some corner of C++ behaviour and you realize your mental model of what C++ is doing is woefully incomplete. C++ is stuffed full of syntax, and obscure interactions between that syntax will continually trip you up. Each of the things in your list is somewhat contained on its own but interacts in surprising ways with every other thing on that list. For example[1], want to create a template friend function for a template class? Prepare for function definitions like: Foo<T> f<>(); Edit: that's not to mention various C++ idioms like CRTP [2] which don't fit neatly with the stuff you listed but are non-obvious and occur in a lot of complex C++ code. [1] http://yosefk.com/c++fqa/templates.html#fqa-35.16 http://yosefk.com/c++fqa/templates.html#fqa-35.16 [2] https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern https://en.wikipedia.org/wiki/Curiously_recurring_template_p...
- hellofunk 10y ago> functional programming (which is not that complicated at all in C++) > I think most C++ programmers have a reasonable command of all of these These gave me a bit of a chuckle. It's true only if you've never done proper functional programming using a genuinely functional language. It's true that you can now pass lambdas around as first-class values easily, store and manipulate them as you might in a functional language, and that's a fantastic convenience. But that's not what functional programming is. None of the idioms you'd use in Clojure or Haskell are wise to use (yet) in C++ (although Niebler's Range library will make a big step in the right direction... in C++20, where it's currently slated for specification). If you try to do real functional programming in C++, you'll end up with a very inefficient program that pales to writing an algorithm with a more procedural or OO idiom. And, in my experience interacting with lots of C++ developers, most do not know what actual functional programming is all about.
- blub 10y agoA discussion about "proper functional programming" is not particularly relevant, because the topic is functional programming in the context of C++. The constructs that C++ offers for FP are not complicated.
- hellofunk 10y agoSorry, but this is just simply not true. If you've never done functional programming before, then I could see why you think doing it in C++ is not complicated. Here is an example of just how large the can of worms gets when attempting to bring functional programming to C++: https://bartoszmilewski.com/2013/11/13/functional-data-structures-in-c-lists/ https://bartoszmilewski.com/2013/11/13/functional-data-struc... and: https://bartoszmilewski.com/2013/11/25/functional-data-structures-in-c-trees/ https://bartoszmilewski.com/2013/11/25/functional-data-struc... And, I disagree that you can change the definition of a particular programming paradigm when discussing a particular language. Functional programming means something that is not really possible in C++. For starters, the fundamental underlying data structures for functional programming do not exist in C++ and there is no third-party implementation of them worth mentioning; the above experiment is admitted by the author to fall flat when doing anything idiomatic. As I mentioned before, C++20 might turn the tide on this front a little bit, thanks to the Range library.
- AlexandrB 10y ago> * OOP C++ OOP is an endless tire fire. I now have 7 years experience writing C++ "OOP" on the job and I still run into surprises when I try to do things that are easy in other languages but unnecessarily hard in C++. Plenty of examples in the C++ FQA[1]. [1] http://yosefk.com/c++fqa/inheritance-mother.html#fqa-23.5 http://yosefk.com/c++fqa/inheritance-mother.html#fqa-23.5
- blub 10y agoI'm not an expert at this, but it seems to me that it would be a good idea to take the time to learn it properly in one go instead of independently discovering all the mistakes that can be made in 7 long years and then being upset about it.