4 ms·
is there a "cpp: the good parts" book that anyone can recommend for someone who has done c/cpp a long time ago?
by blackandblue 7y ago
is there a "cpp: the good parts" book that anyone can recommend for someone who has done c/cpp a long time ago?
- cannam 7y agoBjarne Stroustrup's "A Tour of C++" (http://www.stroustrup.com/Tour.html http://www.stroustrup.com/Tour.html) is close. It's a slim volume that is roughly a survey of the language as if it had begun with C++11.
- blackandblue 7y agothanks
- colejohnson66 7y agoI wish he’d update them (both books) for C++20 (C++2a), or even just C++17.
- steerablesafe 7y agoA Tour of C++ 2nd edition covers C++17, AFAIK.
- pjmlp 7y agoYes it does and also mentions parts of C++20 like concepts and modules.
- adamnemecek 7y agoMy comment might be unwarranted but at this point, considering Rust might be also an option.
- AnimalMuppet 7y agoAll right, same question: Is there a "Rust: the good bits" book that someone can recommend?
- adamnemecek 7y agoThere is the Klabnik one from NoStarch and the Blandy one from O'Reilly. The first one is more towards beginners, the second one is pretty advanced, you build some relatively advanced things. I own both. Part of the appeal of Rust is that there aren't as many bad parts as with C++.
- pjmlp 7y agoI like Rust, but it still has to grow up a bit to be an option for GUIs, iOS/Android, game engine middleware, Windows/macOS systems programming. It will eventually get there, but it isn't there yet.
- adamnemecek 7y agoYou make them yourself. With Rust you might not need those things as much, because you roll these things yourself. What are the GUI frameworks in other languages? Qt? wxWidgets? GTK? These are all so, so, so bad. I'm saying this as I'm writing my own GPU-rendered immediate-mode GUI toolkit with multiple rendering backends. I can't do this in any other language, like...I would legit get stuck on the build systems. You are right, it would be better if there were somewhat better frameworks but I'm ok writing my own. As an aside, my long term dream is to write a next-gen OS in Rust. GPU-first, new application paradigms, compiler comes with the OS, first-class networking support. The languages empowers you to an insane degree. What Windows/macOS systems programming would you want?
- pjmlp 7y agoNo I don't, I rather be productive doing what I am supposed to do in first place. Some examples, DriverKit, COM/UWP, WinUI, Metal Shaders, CUDA, SYSCL, Treble, Unreal/Unity. For all of those I already have a good mix of Swift, .NET, Java/Kotlin and C++, as they are the official OS SDK languages, writing in Rust would just slow me down in its present state. Bad UI toolkits?! Best that Rust currently has is Gtk-rs and that is being nice versus what those toolkits and GUI tooling are capable of.
- adamnemecek 7y ago> Metal Shaders Write a wrapper, it's easy in Rust. Follow this example https://github.com/gfx-rs/metal-rs https://github.com/gfx-rs/metal-rs > CUDA There's a wrapper. https://docs.rs/cuda/0.1.0/cuda/ https://docs.rs/cuda/0.1.0/cuda/ > DriverKit There's a wrapper https://github.com/dcuddeback/iokit-sys https://github.com/dcuddeback/iokit-sys. > Gtk-rs GTK is terrible, Gtk-rs is putting a lipstick on a pig. I need 2D rendering but also power to touch the gpu to write a shader, to use gl_VertexID when I feel like it. The thing about rust is that that I can legit write my own bindings for any lib written in c/c++, anything else. Like you go from zero to dependency included, building in less than 10sec. The build process is insane. Check out this port of nanovg https://github.com/sunli829/nvg https://github.com/sunli829/nvg. NanoVG is a popular project with many contributors, this port is a single person project that's better in many ways. With rust you literally just do "git clone https://github.com/sunli829/nvg" https://github.com/sunli829/nvg" "cd nvg/nvg-gl" "cargo run -p nvg-gl --example demo-cutout" You go from git clone to drawing something interesting to screen in 10 seconds of human time (there might be some time spent building dependencies but whatever, I don't need to touch anything).
- pjmlp 7y agoBesides "A Tour of C++", you might enjoy the following: - "The C++ Standard Library, 2nd Edition" from Rainer Grimm - "C++ Templates, The Complete Guide, 2nd Edition" from David Vandevoorde, Nicolai M. Josuttis, Douglas Gregor - "Functional Programming in C++" from Ivan Čukić - "Concurrency with Modern C++" from Rainer Grimm And any talk from Bjarne or Herb at CppCon or C++Now.