Live data from Hacker News

Modern C++ Programming Course

github.com

121–130 of 221 posts

Re: Modern C++ Programming Course

#121
C++ was my weapon of choice in college mostly because writing graphics stuff in C required re-inventing the wheel a lot of the time for basic data structures and the STL was pretty slick.

Having spent the better part of the last decade writing go though, I think C++'s syntax is a bit too cluttered.

Re: Modern C++ Programming Course

#123

I've been setting up my little docker image that has both llvm/clang/tidy/clangd and gcc inside with boost with an idea I'd run it and from outside use it to code with live checking and compiling without littering my OS. Now, I feel like I'm doing something that already exists but couldn't really find what everyone use, ought of those that would prefer such a setup. Debugger within is probably a pipe dream, but who k…

I find it absurd that a programming language which compells someone to set up a containerized OS just to manage their build toolchain could be considered "modern".

Re: Modern C++ Programming Course

#125

There are at least a dozen C++ intros that go through every little detail like this and I don't get it. I have a pretty good ability to retain a lot of information presented this way, and I've been programming in various C-like languages for long enough that much of this isn't new to me, but this doesn't seem like a good way to learn the material. I'd much rather work through actual programs and iterate on them. I im…

I think C++ and Rust are honestly special beasts. I've heard experienced programmers say that you want to actually pick up a book to learn Rust, and the same is true for C++.

Like you can basically hack your way through learning Python or JS. I didn't learn Python from a book, for sure.

But with C++ and Rust that's not an optimal strategy. You have to do both -- do practical projects, and actually study it a bit.

There's also a huge amount of disagreement about C++, so I think it makes sense to start with a codebase you want to work on, and then ask the people who WROTE that codebase what C++ books and learning materials they like.

e.g. Game C++ is kind of different than Google C++, but both are good (they get work done, and multiple people can work together in that style). There is a lot of really bad C++ out there. The gulf between good and bad C++ is bigger than good and bad Python or JS. You want to learn from experienced people who get things done, not language lawyers

Re: Modern C++ Programming Course

#127

> Heap Memory - new, delete Keywords Should "modern" C++ even use new/delete? I'm a C++ n00b, but I thought these can be avoided entirely now.

Yes, in new code you should be able to replace almost all new and delete with unique_ptr, vector or, more rarely, shared_ptr. Placement new can still be useful, but delete not really. There are some patterns where you use new without a delete for a global singleton that is intentionally never deleted, as well.

It's still useful to learn about the concept when dealing with old code.

Re: Modern C++ Programming Course

#128

I've been setting up my little docker image that has both llvm/clang/tidy/clangd and gcc inside with boost with an idea I'd run it and from outside use it to code with live checking and compiling without littering my OS. Now, I feel like I'm doing something that already exists but couldn't really find what everyone use, ought of those that would prefer such a setup. Debugger within is probably a pipe dream, but who k…

I find it absurd that a programming language which compells someone to set up a containerized OS just to manage their build toolchain could be considered "modern".

I cannot disagree. Gcc is trivial to compile and set with prefix however you want. Llvm behemoth, not so very much though and I'd like to have both for reasons. There's always some gotcha involved, and when you finally set it all up, you forgot what and how you did it and then you dig through shell history file to reconstruct what you did in order to replicate it on other machines or same if you nuke the OS.. blah. Rustup and cargo and pyenv and nvm even spoiled us.

Re: Modern C++ Programming Course

#129

I've been setting up my little docker image that has both llvm/clang/tidy/clangd and gcc inside with boost with an idea I'd run it and from outside use it to code with live checking and compiling without littering my OS. Now, I feel like I'm doing something that already exists but couldn't really find what everyone use, ought of those that would prefer such a setup. Debugger within is probably a pipe dream, but who k…

I find it absurd that a programming language which compells someone to set up a containerized OS just to manage their build toolchain could be considered "modern".

It would truly be absurd to claim that C++ is a modern language. A subset of C++ however, is modern. This does not include the toolchain and standard build practices.
Post reply on HN