I wish there was a good place to learn “the other parts” of C++, the build systems, using static analyzers, testing, dependency management, etc. I’m thinking something like MIT’s “missing semester” course which teaches the boots on the ground part of software like how to use Git. https://missing.csail.mit.edu/ Maybe these resources exist for C++ and I just never found them. I think a lot of “modern” languages get thi…
> I think a lot of “modern” languages get this right by including these things from the start. The experience is so much better. I don't know how others did it, but I learned with MS Visual C++ in 1996. File -> New Project -> press F7 to compile, F5 to debug. That's it. ~30 years ago they got it right. I even remember my Windows CE experience ~15 years ago that allowed to build and debug the entire OS from an IDE. No…
LearnCPP: Website devoted to teaching you how to program in C++
71–80 of 145 posts
Re: LearnCPP: Website devoted to teaching you how to program in C++
#72Earlier quoted context omitted.
I feel the same way. I remember in one of my failed attempts to learn C++ I had been at it for a few weeks, and was excited to start my own little project in it. I needed to use a piece of software on GitHub and I just could not figure out how to get everything to build. It was a terrible experience that put me off the language.
Pulling in dependencies in C++ when you come from something like Python or Ruby is the absolute worst. I just recently fought through a big mess of this, the gist of it is ExternalProject[1] 1 https://cmake.org/cmake/help/latest/module/ExternalProject.h...
Re: LearnCPP: Website devoted to teaching you how to program in C++
#73I wish there was a good place to learn “the other parts” of C++, the build systems, using static analyzers, testing, dependency management, etc. I’m thinking something like MIT’s “missing semester” course which teaches the boots on the ground part of software like how to use Git. https://missing.csail.mit.edu/ Maybe these resources exist for C++ and I just never found them. I think a lot of “modern” languages get thi…
> I think a lot of “modern” languages get this right by including these things from the start. The experience is so much better. I don't know how others did it, but I learned with MS Visual C++ in 1996. File -> New Project -> press F7 to compile, F5 to debug. That's it. ~30 years ago they got it right. I even remember my Windows CE experience ~15 years ago that allowed to build and debug the entire OS from an IDE. No…
Re: LearnCPP: Website devoted to teaching you how to program in C++
#74I wish there was a good place to learn “the other parts” of C++, the build systems, using static analyzers, testing, dependency management, etc. I’m thinking something like MIT’s “missing semester” course which teaches the boots on the ground part of software like how to use Git. https://missing.csail.mit.edu/ Maybe these resources exist for C++ and I just never found them. I think a lot of “modern” languages get thi…
Re: LearnCPP: Website devoted to teaching you how to program in C++
#75Earlier quoted context omitted.
> I think a lot of “modern” languages get this right by including these things from the start. The experience is so much better. I don't know how others did it, but I learned with MS Visual C++ in 1996. File -> New Project -> press F7 to compile, F5 to debug. That's it. ~30 years ago they got it right. I even remember my Windows CE experience ~15 years ago that allowed to build and debug the entire OS from an IDE. No…
And then when something goes wrong, you’ll be staring at an opaque .vcproj file without any idea of what’s going on under the hood and how to fix it.
Yak shaving learning how to use all the compiler and linker flags, and library setup before writing any line of code.
Debugging vcproj files is as easy as going down the boilerplate generated by shell scripts and build generators.
Re: LearnCPP: Website devoted to teaching you how to program in C++
#76C++ is huge and growing every 3? years (C++17, 20, 23...) is it really possible to master or can you only ever get to the point of being good enough to be dangerous?
Re: LearnCPP: Website devoted to teaching you how to program in C++
#77I wish there was a good place to learn “the other parts” of C++, the build systems, using static analyzers, testing, dependency management, etc. I’m thinking something like MIT’s “missing semester” course which teaches the boots on the ground part of software like how to use Git. https://missing.csail.mit.edu/ Maybe these resources exist for C++ and I just never found them. I think a lot of “modern” languages get thi…
For the build system, I like: http://cliutils.gitlab.io/modern-cmake/ In addition to building, it will show how to add cppcheck and clang-tidy to your cmake files. That part is pretty easy. Just don't turn on every check in clang-tidy. Many of them are for specific code bases. Modernization checks are my favorite ones. Keeps you doing stuff the modern way. My link has you doing dependency management with git submodul…
Modern CMake should be using toolchain files to specify the toolchain/flags. That should be included in ever CMake intro. (Hacking those into your CMakeLists.txt is not okay)
gitsubmodules are also a hack
1: Many dependencies are not setup to be used as a CMake subdirectory. Variables such as the project-version-number get overwritten by the parent project and more dangerously the submodule can start to change variables in the overall project.
2: Dependencies will often reuse target names. For instance, libraries often have a target called `uninstall`. Because redeclaring a target in a different subdirectory is a no-no - CMake crashes
Proper dependency management can be done directly through CMake without repeating yourself by using Hunter: https://hunter.readthedocs.io/
This solved the diamond problem, gives you proper namespaces in CMake and with Polly you can have sane toolchain files (https://github.com/ruslo/polly - but you can also just write them manually). Everything is built on CMake and Git (and git hashes). You get nice dependency build caches and forking dependencies is also trivial
EDIT: The creator of Hunter has his own CMake Intro. I haven't gone through it while-learning, but it looks comprehensive and informative: https://cgold.readthedocs.io/en/latest/
Re: LearnCPP: Website devoted to teaching you how to program in C++
#78Earlier quoted context omitted.
Is it a bad idea to learn from Stroustrup's 'Principles'?
as someone that has done a lot of commercial C++ teaching in his time, i would say that this is one to avoid for a beginning programmer. stroustrup is not, imho, one of the worlds great teachers, and i would not recommend C++ as a first programming language. more experienced programmers should go with TC++PL.
Re: LearnCPP: Website devoted to teaching you how to program in C++
#79Re: LearnCPP: Website devoted to teaching you how to program in C++
#80Earlier quoted context omitted.
And then when something goes wrong, you’ll be staring at an opaque .vcproj file without any idea of what’s going on under the hood and how to fix it.
For many kinds of projects, good luck doing it the makefile way (CMake, or whatever one fancies). Yak shaving learning how to use all the compiler and linker flags, and library setup before writing any line of code. Debugging vcproj files is as easy as going down the boilerplate generated by shell scripts and build generators.