5 ms·
I think the argument that Torvalds was making here is that that's exactly what C++ is. Messy and unnecessary. You can write C++, but if you do so without the
by jmj42 15y ago
I think the argument that Torvalds was making here is that that's exactly what C++ is. Messy and unnecessary. You can write C++, but if you do so without the mess, you're so close to C that there's no point in using C++.
I, on the other hand, would argue that C's lack of object-orientation somehow dooms one to implement it. OOP is _not_ the pinacle of software development. Further, I would argue that "structs full of function pointers" neither, necessarily, represents a desire for object-orientation nor is it messy.
- strags 15y agoWhen your source code is full of structs that look like this: struct obj { struct obj_functions* functions; ... } struct obj_functions { void (*do_something_with_object)(struct object* obj,...); ... } ... I'd say it's hard to argue that you're not implementing C++ style OOP, and that it wouldn't be cleaner to use C++. Now, if you're just going to stick to the basics of C++ (ie. avoid templates, operator overloading, etc...), then there's a fair argument as to whether it's worthwhile. Certainly it's not worth rewriting the Linux kernel at this point. But, I don't think Linus's comment that "C++ is a horrible language" is fair. (I'm sure most of that is just Linus being Linus).