Earlier quoted context omitted.
> needs to get the performance gain that C has over C++ With RTTI and Exceptions disabled you should be able to get almost identical performance with C and C++. In some cases C++ compiler has additional information that can allow it to produce faster code as well.
Yup, and if you avoid using any of the new language constructs like objects and whatnot that C++ brings and basically stick to standard C, maybe using just a bit of C++ sugar here and htere, true.... but at that point you might as well be using C, and the argument is really moot.
Linus Torvalds on C++
71–80 of 190 posts
Re: Linus Torvalds on C++
#72Now this has me a bit confused, why no love for STL ? I wish Linus had added more detail. Is the complaint that the binaries are too big (not quite, if you strip them of the unnecessary symbols) ? or is it that it can be a tedium to go over the reams of error messages that compilers spit out when things go wrong. The second point I am willing to concede, it requires you to read messages inside out, which lisp does tr…
Essentially, listing all the hoops EA went through to have a useable STL for games. (And for programming purposes, AAA console games and OS kernels are pretty close)
Re: Linus Torvalds on C++
#73Earlier quoted context omitted.
Haven't seen it. I've seen many other examples of Torvalds being an ass, but I don't bother to keep track really. It does make me wonder though how he's able to get away with responses like that, when most other "founders" (not sure what the proper term here really is) would have the majority of their users/supporters just go elsewhere. EDIT: ... Let alone have supporters who get defensive enough to start downvoting…
I haven't worked closely with Torvalds, but I have worked with other OSS project leads that have such asshole responses roughly proportional to the popularity of the project, and have a theory on it. I don't know if it's intentional or not but many OSS project leads respond like this to questions that come up a lot but don't merit a response. How many times do you think Torvalds has had to field "questions" of the fo…
Re: Linus Torvalds on C++
#74Earlier quoted context omitted.
I think we're missing the point here. Taking the side of the customer of git, I'm happy. I type things on a CLI with git and things happen pretty fast. I'm happy. I don't care whether you wrote it with C, C++ or Haskell. It works. It works just fine. To Linus's point, I've never used, or even heard of someone using Monotone. That must say _something_.
I've used Monotone. It's pretty horrible if you ask me.
Re: Linus Torvalds on C++
#75Earlier quoted context omitted.
"...rather than re-inventing the wheel with structs full of function pointers." I think you got that backwards. Structs full of function pointers predate c++. Going for the ad absurdum, why bother inventing C++, it's just a re-inventing of the structs full of function pointers wheel?
You're right - "re-inventing the wheel" is probably the wrong phrase - I used it because it conveys a sense of needless effort when there is a better alternative. Basically, those who don't have access to basic object-orientation are doomed to implement it themselves in a messier, more verbose form.
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.
Re: Linus Torvalds on C++
#76Bad programming is language agnostic. Disliking a language generally implies that you don't know enough about it to really get it.
Re: Linus Torvalds on C++
#77Re: Linus Torvalds on C++
#78Earlier quoted context omitted.
I guess what I'm really interested in here is, if git isn't an appropriate project for C++, just what is?
AAA games, browsers... Really, anything where you need to have some abstraction but performance is still critical.
The problem is not so much that C++ is a worse language than C - it's that it makes it insanely easy to shoot yourself in the foot in hideously complex ways that take forever to unravel. See e.g. two phase name lookup - http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.h...
There are plenty of other places where the design constraints of C++ have forced it into a dark corner on the edge of the realm of madness. It _does_ buy you additional abstraction, but there is a price you pay for that.
Personally, I'm not happy with either camp. C shows its age - it's from the 70s - and C++ is just out of control. So I'll continue to use both unless there's a decent replacement. (I'm squinting at Go, Rust, and BitC - and none of them are quite what I'd like to see)
Re: Linus Torvalds on C++
#79Earlier quoted context omitted.
[deleted]
Linux and Git exist fine without C++. C++ is many, many orders of magnitude more complex than Java, as Java was designed to be a C style object orientated language done correctly (i.e. with the foot shooting elements removed...)
Re: Linus Torvalds on C++
#80I tend to take everything Linus says with a grain of salt. Not because he's wrong, or because he doesn't know what he's talking about, but there's enough of the puckish troll in him that I tend to read his posts more with an eye to their intended effect, than to what he's actually saying. There are plenty of applications for which c++ is a perfectly sensible language choice. Git isn't one of them.
If I understand what proponents of C++ say, C++ is supposed to be suited best for medium-level programming where abstraction is helpful but low-level constructs and speed are still helpful. It's supposed to give you many of the benefits of higher level languages while still giving you high performance. It's intended to be widely portable but still easily hook into special OS-specific facilities. This description soun…