Live data from Hacker News

LearnCPP: Website devoted to teaching you how to program in C++

learncpp.com

61–70 of 145 posts

Re: LearnCPP: Website devoted to teaching you how to program in C++

#61

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…

Conversely, systematically starting a tutorial by listing and briefly explaining the important sections that will not be covered in order to avoid confusions during reading really help newcomers and make them confident.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#62
Is this website any good? It's heavily pushed by some C++ subreddits.

I don't even know what I would recommend to a newbie. I learned C 25 years ago, and dabbled in C++ 2 or 3 times since then.

Bjarne's books might be great, but they aren't for anyone new to C++ and especially not anyone new to programming in general. C++ For Dummies/21 Days style books are just bad. And there are more bad websites than I can count.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#63

C++ 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?

You end up mastering a subset of the language. Typically whatever you use at work or in your free time. Whether that subset is 10% or 90% is kind of up to you.

There was an old joke about everyone using a different subset of C++ but like most jokes it's mostly an over exaggeration.

C++ (and C) have amazing backwards compatibility and there is a strong chance that code written 30 years ago will still compile, link, and run as long as the dependencies haven't also changed too much (I'm looking at you Win32, X11, Motif). That gives you the time to migrate code bases over time without the fear of being left behind and unsupported.

Even if, for some reason, you were writing C++98 for the last 30 years, it shouldn't be too difficult to make the jump to newer standards. The biggest change, in my opinion, is lambdas and move semantics, and it's not to difficult to apply those to an old code base (if you want to) and start modernizing it. Some people say C++20/23 is a new language but the fundamentals of C++ haven't changed too much and I'd say it's easier to learn C++23 coming from C++98 than it is to learn Rust coming from C++98.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#64

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…

This is a good idea. Most modern languages have their own build tool which handle most of these things, so this requires some separate learning with C++. Some ideas for a curriculum: Context - C++ as a standard, compilers as implementations - a build tool's role in handling compilation and linking - compilers having limited abilities, having limited warnings and analysis by default Build tools - evolution: e.g. make…

Having build tools in the language is a negative if you have more than one language in your project has two build tools.

Sure it is easier for simple projects, but C++ is not for simple projects.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#65

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…

This is a good idea. Most modern languages have their own build tool which handle most of these things, so this requires some separate learning with C++. Some ideas for a curriculum: Context - C++ as a standard, compilers as implementations - a build tool's role in handling compilation and linking - compilers having limited abilities, having limited warnings and analysis by default Build tools - evolution: e.g. make…

In a C++ course we teach at the Technical University of Munich (for students coming from a non-CS background), this is pretty much the direction we have recently steered the curriculum. It is amazing how we were always expected to "just figure out" all these very important practical aspects by ourselves as students, while these are so complicated for C++. In combination with a lot of outdated material out there, students end up feeling lost and giving up, or going through a lot of pain to develop even simple projects.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#66

As a newbie into programming, I get pulled all the time by people to learn my first compiled language either in C++ or Rust. Every time I ask even the most innocent question in any forum it becomes a shitshow, and I can see, I'm late to the party here in HN.

Personally I'd say that unless you're going into game dev where C++ is still widely used (or you want to work on legacy codebases that are in C++), learn Rust instead. Or even learn C rather than C++. C++ has a huge gap between the modern and proper way to do things and the old footgun-riddled way of doing things, and it's just a mess.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#67
post #33

The website sometimes fudges things with somewhat-incorrect statements. Maybe it's a minor issue, but I noticed that it says, for example: > When an initializer is provided after an equals sign, this is called copy > initialization. Copy initialization was inherited from the C language. > > int width = 5; // copy initialization of value 5 into variable width > That's not quite right. Consider the following program: #…

Copy initialization does not mean that the copy constructor is called. It is the correct term for an expression `T a = ...;`, which can often result in the copy constructor being called but does not have to. In this case it's mandatory copy elision from a prvalue, which leads to only one constructor being called.

You are absolutely correct. It turns out "copy initialization is the formal term used. It's kind of stupid IMHO, since it may not be initialization by copying or using a copy of anything, but:

https://en.cppreference.com/w/cpp/language/copy_initializati...

So I half-take-back my comment.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#68
post #57
post #29

Earlier quoted context omitted.

Sorry, but Rust is doomed to be forever solely used for meme startups and nth rewriting of basic UNIX utilities.

Similarly, sorry, but C++ is doomed to be forever solely used for (a) maintaining codebases that noone wants to maintain but doesn't have a choice, and (b) organising cpp conferences to maintain self-confidence of a crowd of programmers whose skill set is becoming more and more outdated. /s /s

at the very least it will be needed to maintain the backend for the rust compilers.

Re: LearnCPP: Website devoted to teaching you how to program in C++

#70
post #23

Earlier quoted context omitted.

For Java'eans, here's an interesting StackOverflow question about why there's no Garbage Collector in C++ and what it means: https://stackoverflow.com/q/147130/1593077 and my particular answer: https://stackoverflow.com/a/48046118/1593077 in essence, with Modern C++, it is relatively easy to just not produce garbage which needs to be collected :-)

I've been getting back into C++ after an extremely long hiatus and I've been impressed by how thoroughly modern it is. The worst crime you're likely to commit these days is accidentally invoking a copy constructor more often than you want to, and even then, not actually creating leaks. In fact, the most striking thing coming from a language like Java or C# isn't memory management at all, is how utterly non-OO C++ act…

Even when C++ was created, object-orientation was not a goal, but rather a means to an end. Yes, that was a significant feature, and the original name was "C with objects", but even then it was only part of the bigger picture, and that part got smaller over time. The next big step away from an OO-orientation of the language (no, that's not a typo) was when the STL was adopted into the standard library - with its iterators and templated mini-algorithms. At that point it could certainly be said already that C++ is a multi-paradigmatic language, and that's become even more true over time.

You could definitely (?) implement a Java-like container framework, with class like Iterable or IEnumerable and almsot every OO bell and whistle - if you wanted to. But it would not be very useful.

Post reply on HN