PDA

View Full Version : Linus Torvalds hates C++



ErosOlmi
24-09-2007, 07:38
http://thread.gmane.org/gmane.comp.version-control.git/57643/focus=57918

What nice and polite discussions ;D

Petr Schreiber
24-09-2007, 10:03
Hi,

I did not expect it to be that brutal ;D


Petr

Michael Hartlef
24-09-2007, 16:19
A good read, that's for sure. :) Felt like some times in the Codingmonkeys forum ;)

ErosOlmi
24-09-2007, 16:45
I remain quite bad impressed on the rude replies Mr Linux did.
Ok, his "opponent" came in and the first post he did was about C++ but later posts explain it better. Why not remain polite?
Maybe open-source world is quite a jungle, and if you are not the lion you will be the meal of the lion.

Michael Clease
24-09-2007, 16:50
Best we keep the animals out then ;D

Randall
24-09-2007, 18:01
Seems hard to believe the primary spokesperson for Linux would publicly post in such a manner. I do not follow Linus Torvalds, and cannot judge if this is in character for him. Could this be someone impersonating Linus Torvalds in an attempt to discredit him?

Michael Hartlef
24-09-2007, 18:15
Well, I know a few very talented coders who are asses when it comes to communicating with their users or other people. They think they are high and mighty as they get treated like they are. To some people these people are like gods. I kinda can imagine where an attitude like this comes from.

hemmrao
28-07-2010, 19:07
For me Letus-C book helped a lot :read: very good read . .

zlatkoAB
28-07-2010, 20:25
Who knows what he mean about Basic ?

LanceGary
29-07-2010, 00:34
Well, I know a few very talented coders who are asses when it comes to communicating with their users or other people. They think they are high and mighty as they get treated like they are. To some people these people are like gods. I kinda can imagine where an attitude like this comes from.


To me it reads like the writings of someone who has had every decision criticized and who now reacts to even mild criticism. It is hard when every one has access to your code and feels free to tell you that you could have done it so much better had you done it using X or Y or Z. Just my opinion, of course.

Lance

kryton9
29-07-2010, 03:19
Lance, I think what you said would have an impact on anyone. And really trying to use c++, I do find the mix of coding styles really tough to deal with. Especially in a case sensitive language.
If you want uniform looking code you need to write wrappers. But with many good IDE's the intellisense helps keep track of the syntax easier. But without it, for someone with poor memory like me, it would be a nightmare.

c++ is a language that you need to spend time with to really start to love it. Boost and STL should be how they start to teach all new c++ users, if you ask me. It offers many things that once you learn them you don't need to deal with c side effects that plague c++ otherwise.

JosephE
29-07-2010, 04:53
I've heard that if you like compiled C style programming languages, that you should use D...

zlatkoAB
29-07-2010, 15:27
And really trying to use c++, I do find the mix of coding styles really tough to deal with. Especially in a case sensitive language.

@Kent i was wondering why you trying to learn and use C/C++
is something specific that you want make using C++ language
or just to proof your self that you can.
Knowlege of using any programming language is good point
but way using and confusing your brain with such a ugly and
unhuman syntax is to much for me.
C++ is powerfull language in hands on very knowlege programer but
is not allmighty language..

kryton9
05-08-2010, 22:03
Aurel, it started out as a challenge to myself. I dabbled with C in the early 1990's and since then knew that C++ was the beast I wanted to learn at one point.
Most of what gives c++ a bad feel is the c heritage. If you are writing new code from scratch and not using other libraries, your code can be quite clean and really pleasant.

Now looking at Basic code, it feels naked without the ; as the line terminator to me :) So it shows how one can get used to a certain look after awhile.

It took me this long because I was coding in other languages and going back and forth, c++ seemed tedious. That is why I really focused my efforts at looking mostly at c++ code and that really helped.
Also as I said, the boost libraries (which are just header files mostly) and the Standard Template Library have lots of modern very easy to use data structures(containers), algorithms and management of pointers.

It also helps to pick on IDE and really learn the shortcuts and features. I find Code::Blocks with MingW32 gcc compiler a perfect match. If you are going to do wx programming, then wxDevC++ is the way to go. wxWidgets works right out of the box! Also it makes use of the Devpaks which make installation of third party libraries really nice.

If you or anyone else is wanting to learn c++, then I highly recommend just looking and working in nothing but c++. You will overcome the things that push us BASIC syntax guys away a lot quicker.

efgee
16-08-2010, 04:13
Used C++ for some stuff I was doing and after a while it grew on me, but IMHO with a better parsing mechanism the need to use ";" most of the time could have been avoided (from a BASIC programmer point of view). IMHO Pascal suffers the same pain in this regard... On the other side some programmers feel naked without the ";".
But IMHO the ";" is more bearable than the Python syntax with their dangling code. Some may love it though, otherwise Python would not be so widely used.

Lately I wanted to incorporate even more C++ in my coding and installed GCC4.5.0 but it's a nightmare. They added so many new header files and DLL's after version 3.4.2, that when you don't use the whole GCC package but only some programs out of it like cc1plus.exe (in conjunction with ar, as etc.) and some header files you get lost. Finally managed to get my code to work again, but had to add tons of new header files and additional DLL files.

Now I'm thinking of reverting back to GCC 3.4.2 :P

Charles Pegge
16-08-2010, 11:12
In my very limited experience of C, I have not encountered any situation where the semicolon at the end of a line was a necessity. When Oxygen reads C headers directly, the default interpretation of semicolon is left as Comment. I have not seen any instance where semicolon is used in the middle of a line as a statement delimiter as we would use a colon in Basic. This seems to be the convention.

The end of a statement is quite easy to infer with a few extra checks by the compiler's parser.

Charles

ErosOlmi
16-08-2010, 12:40
Same here Charles.

While building many parsers I've always asked myself why C, C++, Java, C#, pascal, ... need those end of statement.
It is so easy to avoid it by the parser and at the same time syntax would remain perfectly clear.

Yes, I saw where such end of statement can be used: Obfuscated_code
:D

efgee
18-08-2010, 23:47
... When Oxygen reads C headers directly, the default interpretation of semicolon is left as Comment. I have not seen any instance where semicolon is used in the middle of a line as a statement delimiter as we would use a colon in Basic. This seems to be the convention.


Yes the semicolon is a statement delimiter; if oxygen treats it as a start-of-comment symbol then c code that has more than one statement per line would not be parsed correctly and all statements after the first would be lost.

efgee

Charles Pegge
19-08-2010, 04:29
Yes that is true. Oxygen understands enough C to be able to read C headers but not all of C. The semicolon is a standard comment marker in assembly code - We have a potential conflict here since Oxygen allows Assembly code to be freely combined with other statements.

Another issue is C case sensitivity. To avoid the imposition of full case sensitivity, Oxygen can be made sensitive only to fully capitalised words with the #case capital directive. In most instances this is sufficient to enable Oxygen to distinguish symbols in C headers correctly.

But nothing is cast in stone :)

Charles