Live data from Hacker News

Linus Torvalds on C++ (2007)

thread.gmane.org

21–30 of 33 posts

Re: Linus Torvalds on C++ (2007)

#21
Everything I've ever wanted to be able to do with C++, I can do with Lua. I see it as the obvious progression from C - though I still find C a highly useful language. Putting Lua on top of whatever needs to be low-level, written in C, provides the next-generation toolset that I find so very productive.

Re: Linus Torvalds on C++ (2007)

#22
post #18

"The fact is, git is better than the other SCM's. And good taste (and C) is one of the reasons for that." If he likes simplicity and good taste then why did he pick Git over Mercurial? Because he did not implement the latter?

.. because he actually understands Git, perhaps?

Re: Linus Torvalds on C++ (2007)

#23
post #9

I agree with Linus. C++ is too complex and overengineered, and taking in contributions in it for something like git, is a recipe for disaster. However, C in all its simplicity already has its potential for abuse. Macros can go very bad. Very bad. (Just look at openSSL). It is also not difficult to abuse the left-right rule in pointer arithmetic: *x->a->c=5. It can easily become incomprehensible. We did not need C++.…

>We needed a way to further simplify C.

Lua is the answer. :P

Re: Linus Torvalds on C++ (2007)

#24
The fact that C++ is vast is well known. If a language supports some arcane things then it will end up in the code (even if its very less percentage wise). Because its arcane, most of the developers will not be able to deal with it effectively. Example of arcane: overloading comma operator.

Re: Linus Torvalds on C++ (2007)

#25
post #18

"The fact is, git is better than the other SCM's. And good taste (and C) is one of the reasons for that." If he likes simplicity and good taste then why did he pick Git over Mercurial? Because he did not implement the latter?

.. because he actually understands Git, perhaps?

That's not an argument, Bjarne Stroustrup understands C++, does it make it elegant or simple?

Re: Linus Torvalds on C++ (2007)

#26
post #6

> inefficient abstracted programming models where two years down the road > you notice that some abstraction wasn't very efficient, but now all > your code depends on all the nice object models around it, and you > cannot fix it without rewriting your app. The opposite can also be said. By re-inventing a simple data structure, you can end up 2 years later in the same position where your structure is inefficient (list…

> While implicit operator overload was probably a C++ mistake

are you talking about the implicit conversion operator or operator overloading in C++?

For the former, it has been vastly improved in C++11 with the addition of explicit conversion operator. For the later, some very important capabilities of C++ rely on operator overloading namely the assignment operator (copy/move assignment) and the function operator (allows what C++ calls functors). Another useful thing with operator overloading is allowing the creation of generic functions that work on existing types (int, float, ..) and user defined types, for example std::accumulate.

Re: Linus Torvalds on C++ (2007)

#27
In the spirit of Greenspun's 10th Rule

Any sufficiently complicated C program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of C++.

For example: 1) Macros for data structures instead of templates 2) Virtual functions emulated with function pointers 3) goto fail instead of exceptions

Re: Linus Torvalds on C++ (2007)

#28
post #25

Earlier quoted context omitted.

.. because he actually understands Git, perhaps?

That's not an argument, Bjarne Stroustrup understands C++, does it make it elegant or simple?

If you ask Bjarne, I'm sure he'd have a position that would be based on his understanding. Same as asking Linux about Git leads him to answer: it is elegant and simple.

I think the question is, what makes reality - an individual opinion, or the mass-consensus? This is always a delicate question to ask.

Re: Linus Torvalds on C++ (2007)

#29
My biggest problems with C++ (one of my favorite languages) 1. ABI issues. 2. Template Error messages. 3. Templates need be defined in header files (generally). 4. Object Slicing. 5. Cross platform Unicode/ASCII string encoding.

I understand the reasons behind these, none the less they are really annoying.

Post reply on HN