5 ms·
I can't believe a 300 pages book is needed to just talk about initialisation in C++!!! Now I understand why Linus refused this craziness in the Linux kernel. I
by afr0ck 4y ago
I can't believe a 300 pages book is needed to just talk about initialisation in C++!!! Now I understand why Linus refused this craziness in the Linux kernel. I genuinely believe that C++ is just a toxic wasteland of time. It's not even that productive, fun to work with or secure. I would take C, Rust, Golang, Python anywhere, anytime.
- qwerty456127 4y agoIt's not to just talk about initialisation in C++, it's to to just talk about modern initialisation in C++! Imagine how much more ther is if you wanted to know everything about initialisation in C++ not limited to the modern things.
- nikbackm 4y agoIt's not needed. There's a lot of extra fluff like examples and such beyond the basics of C++ initialization. Also seems to have relatively little text per page in the Amazon preview [1]. [1] https://www.amazon.com/dp/B0BW38DDBK?asin=B0BW38DDBK&revisionId=&format=4&depth=1 https://www.amazon.com/dp/B0BW38DDBK?asin=B0BW38DDBK&revisio...
- ModernMech 4y agoSure but at the same time, the author says the book started as a blog and some examples, and “before you know it” was 150 pages. To me, you should have been able to write all that needs to be said about initialization several times over with that much space, let alone 150 pages more!
- dgellow 4y agoYou don’t need these 300 pages. It’s not because a book is that long that it is needed. It’s a niche book for C++ enthusiasts, like the book on std::move (one that I personally enjoyed greatly)
- mhh__ 4y agoLinus refusing this in the kernel arguably set it back quite a bit IMO. Lots of the kernel is the kind of "simple" you only get with C i.e. macro hell and lots of repetition. For example with a proper C++ class you could make /proc/ output a proper format seamlessly whereas with C you basically have to either write a fuckload of scaffolding or just repeat everything. Also you can write a full book just about C pointers, it's up to the author how far they can stretch it. N.B. I also am not a huge fan of C++ but certainly for the past 10 years I think it's a net loss not using it.
- tialaramex 4y agoLinus objected to C++ partly because it has far too much implicit allocation. If you look at how much surgery is required to make the Rust for Linux alloc work you can see he was quite serious. For example Rust for Linux Vec::push doesn't exist, because if the Vec wasn't big enough that's an implicit allocation, instead Vec::try_push is provided, which is fallible. There was nobody proposing to even attempt that kind of work for C++.
- gpderetta 4y agoLinus refuses to use C++ because he literally believes us C++ programmers are subhumans. I don't think his position is entirely rational (and, understand, I have otherwise huge respect for him as an engineer).
- account42 4y agoC++ doesn't have any implicit allocation. The standard library does but that is no-go for the kernel anyway. Doesn't preclude using templates, classes and other C++ features in the kernel - and some external proprietary drivers already do.
- zabzonk 4y agoi doubt that torvalds (or you) has ever written a significant program in c++. if he has, where? and if you have not written a significant program in a language, you do not get to judge it.
- pascal_wizzard 4y agolinus has subsurface
- zabzonk 4y agomeaning what?
- bheadmaster 4y agoMeaning that he has written a significant program (called Subsurface) in C++.
- zabzonk 4y agoso, let me get this straight. he wrote an application for a dangerous pastime (diving) in a language that he has many times publicaly despised? cool.
- tephra 4y agoI doubt that it is strictly _needed_. Most C++ programmers will probably live life gloriously without having ever read it. But if you really want to know every nook and cranny of C++ initialisation (which I sincerely hope I will never want) then it seems like a great thing that this book exists! Niche knowledge is fantastic for those who want it or need it. No need to knock it just because you don't.
- temp00345 4y ago> I genuinely believe that C++ is just a toxic wasteland of time. It's not even that productive, fun to work with or secure. I would take C, Rust, Golang, Python anywhere, anytime. Please reconsider bashing it that much, if not out of respect for the people who use this tool daily, then out of the observation that the program you used to write this message was probably written in or uses libraries written in C++. It's a powerful tool and has been used to create amazing things in competent hands, so maybe its flaws, that we like to bash so much, are a great thing - it's what drove people to create all this other languages that we love to experiment with.
- tialaramex 4y agoC++ isn't a person, and so we're not hurting its feelings by pointing out that it's terrible. If we hurt Bjarne's feelings by criticising his baby I'm sure he'll get over it. I don't see much difference between pointing out that C++ is a bad idea despite the fact that some good software was written using C++ and pointing out that slavery is a bad idea despite the fact that some famous US landmarks were built using slave labour.
- Joker_vD 4y agoYou know, you can replace "C++" in your comment with "PHP" and it would still be just as correct. But that doesn't make PHP (or C++) any better than it actually is. Also, "reconsider bashing it that much, if not out of respect for the people who use this tool daily", wow. Surely you don't mean that respecting people who are in a tough situation (e.g. having to write C++ daily) involves never pointing out that the situation they are in is, indeed, tough and could be better?
- codr7 4y agoC++ has it's ups and downs. It's still semi-compatible with C, templates are about as close to macros as you'll get with a syntax; and the algorithms parts of stdlib are in many ways brilliant, thanks to Stepanov. But the complexity is definitely overwhelming.
- Koshkin 4y ago
- AnimalMuppet 4y ago> I genuinely believe that C++ is just a toxic wasteland of time. It's not even that productive, fun to work with or secure. I would take C, Rust, Golang, Python anywhere, anytime. Specifically compared to C, there's a reason so many people switched to C++. They weren't sheep. They weren't just following marketing. If you don't understand what was better about C++, then you're criticizing from a place of ignorance, which is not likely to provide valid criticism. Now Rust, Go, Python... there are reasons at least some people switch from C++ to those languages.
- rascul 4y ago> Now I understand why Linus refused this craziness in the Linux kernel. Here's the old post for reference: https://lkml.org/lkml/2004/1/20/20 https://lkml.org/lkml/2004/1/20/20 Also, one for git: https://lore.kernel.org/all/alpine.LFD.0.999.0709061839510.5626@evo.linux-foundation.org/ https://lore.kernel.org/all/alpine.LFD.0.999.0709061839510.5...