Ask HN: Best way to learn modern C++?
141–150 of 184 posts
Re: Ask HN: Best way to learn modern C++?
#142Earlier quoted context omitted.
The issue with D is not mandatory garbage collection, rather its quality and anti-GC religion. Joe Duffy mentioned on his Rustconf talk that Windows devs even with Midori running in front of them, it was still a very hard sell for them to psychology accept it as doable. The problem with Ada was basically expensive SDK, Pascal-like syntax and not being part of OS SDKs. Only systems programming languages that are bundl…
> Windows devs even with Midori running in front of them, There were GC'ed operating systems in the 80s. The point is not this. It's writing applications where you can maximize your CPU usage. If it's a game, it means that you want to write your code so that the highest number of objects are visible on screen and are being updated on each tick. If its's a multimedia software, you want to be able to run most sounds /…
The last generations of Oberon OS had support for video editing applications as an example.
There are real time GC applications in production being used to control weapons systems, including live targeting and soft real time factory automation systems.
Regarding D, using @nogc or -vgc allows the developer to control when the GC works, it at all. What the language lacks is a GC that can match real-time GCs used in soft real time systems.
Re: Ask HN: Best way to learn modern C++?
#143- Tour of C++ ( http://www.stroustrup.com/Tour.html ) - Principles and Practice Using C++ ( http://www.stroustrup.com/programming.html ) - From Mathematics to Generic Programming ( http://www.fm2gp.com/ ) - The Scott Meyers books Some of the Bjarne Stroustrup videos, "Learning and Teaching Modern C++" - https://www.youtube.com/watch?v=fX2W3nNjJIo Some of the Herb Sutter videos, "Writing Good C++14... By Default" - ht…
Re: Ask HN: Best way to learn modern C++?
#144I have a question on this topic which is - is it possible or practical to only learn "modern" C++? Isn't it necessary to be able to understand pre-modern C++ in legacy code bases or to work alongside a co-worker who might code using an older style? Or even to be able to understand documentation and texts about C++ from an earlier era?
I share your concern. Even if one isn't (knowingly) dealing with older C++ code, all of the language rules apply to every line of C++ being compiled. Just one typo, or misguided use of syntax, and a person might be using some "older" revision of the language without knowing it. And I'm not aware of any tool that will warn the programmer that he/she has done that. So I'm concerned that programmers schooled only in "mo…
Same. And I think you articulated the specific concerns I have about just learning the "modern" version.
It would certainly lower the barrier to entry in learning C++ if this was an unfounded concern.
C++ has some 35 year of history and changes at this point. This point alone adds(for me anyway) to the perceived cognitive load of learning it. C also has a similar length of history but it is a much smaller language.
Re: Ask HN: Best way to learn modern C++?
#145Anyone aware of good, thorough, (online) material to learn C++ template programming?
Re: Ask HN: Best way to learn modern C++?
#146Piggybacking of this post, if anyone has any similar resources for best practices in modern C I'd be interested. There don't seem to be any moocs that go beyond introductory material and K&R obviously doesn't cover modern tools and methods.
Re: Ask HN: Best way to learn modern C++?
#147Earlier quoted context omitted.
Qt is about the last library I'd call modern in terms of C++ dialect it employs or requires... (There are worse but deprecated like MFC. Or on par like wxWidgets.)
I suspect your intel on Qt's C++ use is a bit out of date. Qt nowadays uses (and requires) C++11, as well as more modern constructs.
Re: Ask HN: Best way to learn modern C++?
#1481: Experimental, throw-away code: online IDEs or Godbolt if I care about compiler output. You would be surprised how much mileage you can get out of a simple online IDE when you are just learning or exploring a new thing and don't care about preserving your work.
2: Single-file code or small multi-file projects with no dependencies (like exercises or code samples from a book): direct calls to clang++/g++ in the command prompt or a simple build.sh shell script when I have to build multiple files. Make is a fantastic tool for this so you can learn and use that instead. I would actually encourage beginners to play directly with the compiler and learn the basic flags though, but this is personal preference.
3a: Personal projects that pull in other dependencies (either system wide or libraries from github or other sources): Make or cmake would probably work here equally well. I actually prefer cmake for its find_package and external project functionality. Notice the jump in complexity from 2 to 3, this is something you have to deal with and eventually you will have to pick a build tool and learn it.
3b: After learning to use Bazel I have mostly migrated to it for all my personal projects, but there was an initial learning curve for sure (not worse than cmake though).
4: At work: Whatever your company/team/group uses, you will most likely have little input on this if the codebase is old and established.
If you are in Windows you can use vanilla Visual Studio C++ (Community edition is free and has all the bells and whistles) for 1-3, or use Visual Studio + cmake (you can generate VS solution files from cmake).
Re: Ask HN: Best way to learn modern C++?
#149I found "C++ Primer" by Lippman et al very well written and comprehensive. It includes C++11 features and every chapter has exercises to make sure you understand the content. https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/03217...
Already outdated by 6+ years though.
Re: Ask HN: Best way to learn modern C++?
#150A lot of the C++ language is sort of experimental. Sometimes features get thrown in and then deprecated and/or taken out, like the "export" keyword for templates, or throw specifications. Most programmers have strong opinions about which C++ features are bad. But that's all they are-- opinions. The C++ standard supports pretty much any way of doing things you could imagine-- async, sync, multiple inheritance, functional, you name it.
If you're a novice, my advice is to learn C really well. Then choose a C++ style guide and follow its recommendations closely.