7 ms·
C++ is really hard. I have learned enough about it to understand that there's a lot of idiomatic ways of achieving things that I do not understand, especially w
by partycoder 10y ago
C++ is really hard. I have learned enough about it to understand that there's a lot of idiomatic ways of achieving things that I do not understand, especially with the latest standards.
When someone claims to know C++, especially in a recruitment context, I tend to challenge that, since it's really hard to actually believe these days. Some people claim to know C++, but basically just write everything as if it was C.
- pjmlp 10y agoThe same is true of any language with similar history. Do you believe anyone knows Perl, Python, Ruby, Java, C#, Ada, Haskell, OCaml, VB.NET, F#, ... across all language versions, the whole standard library, and most used third party libraries? One always need to focus on a specific domain.
- daurnimator 10y agoFWIW, this is why I use lua as my primary language: it's the only language I can keep all in my head at once.
- 0xFFC 10y agoI would love to read about your experience with Lua. I always thought lua is for some limited things.
- daurnimator 10y agoWhat sort of thing do you want to read? I have tagged posts on my blog: http://daurnimator.com/tagged/lua http://daurnimator.com/tagged/lua but that's probably mostly library release annoucements.
- loeg 10y agoThe obvious comparison is C — where it is common to know 95-100% of the language. (The 5% I'd pick is general disagreement about expectations of UB and "weird" pointers, like pointers to array types.)
- pjmlp 10y agoPeople that don't write portable C code think that they know 95-100% of the language. I don't miss the days in the late 90's, early 2000, writing portable C code across multiple compilers from each OS vendor, across all major UNIX flavours and Windows. Many that think to master C, actually master C in compiler X targeting OS Y.
- loeg 10y agoWhat a sweeping generalization. Perhaps. But it's certainly easier to master portable C than portable C++.
- pjmlp 10y agoYes, that is quite true. However I prefer that pain, to the lack of strong typing that C++ offers over C. But better would be to use something else instead of C and C++, more type safe, without UB and without the wide range of implementation differences and compiler extensions.
- TickleSteve 10y agoC++ is not one language... there are many styles, for example: - 'C with objects'. - 'Everything is a template'. - 'Embedded C++' (its a real standard, google it). - functional. - 'modern'. (thats not a complete list either). Each one of those is technically the same language, but they're all using a different subset of features and are almost unrecognisable from the rest.
- partycoder 10y agoIt is one language. Many of those subsets are not mutually exclusive. Regardless of what your preference is, if you claim to know C++ you need to at least know some of its basic features, such as references, streams, templates, STL, etc. (features that have been around for a long time). And if you claim expertise, to at least be familiar with basic features from the new standards.
- TickleSteve 10y agotrue, they're all overlapping subsets.... The point being that the way you structure your software in each of those styles is very, very different. They're all idiomatic C++.... just different idioms. In fact, thinking about it, thats what it is... C++ is a multi-idiom language.
- ratboy666 10y agoSure, with an execution model that is so complex that it takes scientific experimentation to determine the /best/ (in terms of execution speed) to write code to manipulate a simple memory mapped device. (This, from the lecture). That is so complex, it is the only language that I need the language at hand to read someone else's code. Not a library reference, a /language/ reference. Indeed, I am maintaing one C++ application. This is a wrapper for CEF3 (https://cefbuilds.com/ https://cefbuilds.com/). This is the Chromium browser as a library. I have to support the library and wrapper on two platforms: Linux 64 bit and Windows 64 bit. Note that the usual Windows build uses the Microsoft C++ compiler. But, I am uses mingw. This requires source code edits to compile! I blame the complexity of the language. Indeed, C++ is so difficult that the shop I work for (which is, by the nature of our product, very conservative) has gone to Java instead.
- satysin 10y agoI 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...
- RandomOpinion 10y ago>Some people claim to know C++, but basically just write everything as if it was C. Nothing wrong with that; that's not uncommon in embedded systems development.