Why is C++ hated so much here in /prog/? Many good software are written in C++.
I'm aware that there are some problems in the language and it is considered "hard" to master it, but why do so many people hate it? What harm has it done?
Software can be written much quicker when using some scripting languages like Python. Software can be writte slightly quicker when using some managed language like Java. But when using those languages, the resulting program will require more resources to run. So there is place for C++.
For example, I bet the web browser of 99% people browsing /prog/ is written in C++. It's not perfect language, but it is the best language for complex program with relatively small CPU and RAM requirements.
For example, I bet the web browser of 99% people browsing /prog/ is written in C++
They usually develop their own class libraries instead using standard ones. And they use only a subset of C++. Thus you end reinventing the wheel. C++ is only useful for very big projects like web browsers, where every megabyte of memory and every cpu cycle is important to compete in a industry where every microsecond in a benchmark counts for marketing purposes.
But also take a look at memory leaks and bug reports on these C++ written browsers. Then you'll see why using that language is just wrong.
C++ is bloated OOP C done wrong. It's not compact, it's not as fast as it could be, it's not easy to develop, it's full of pitfalls, feature creep, overly complicated and not portable enough. It gets low-level things wrong and thus ruins the high-level abstractions it tries to give the programmer.
>>1 Many good software are written in C++.
They might be as well written in Brainfuck. That doesn't make Brainfuck a good language. I'm aware that there are some problems in the language
Too many problems. and it is considered "hard" to master it,
It's not hard to master, it's unnecessarily complex. but why do so many people hate it? What harm has it done?
The same harm COBOL, BASIC and FORTRAN did: it hinders the development and use of better languages. But when using those languages, the resulting program will require more resources to run. So there is place for C++.
We need better languages for system programming, C++ is not one of them. Until recently, nobody cared about making better system PLs, because if they did, they would just be discarded for being ``not C++''. And this is part of the harm it has done, along with C, COBOL, FORTRAN. For example, I bet the web browser of 99% people browsing /prog/ is written in C++.
Again, it might be as well written in COBOL, it doesn't make COBOL any better.
Name:
Anonymous2012-01-08 13:11
>>13
Ok, could you list some of the worst problems that C++ has? Some problems that make it worth hating?
>>17
Anything with a module system is better suited for large project than C++.
Name:
Anonymous2012-01-08 13:21
>>15 Have you read your C++FQA today?
I read some of the "Big picture issues" there. Most of them are just claims without exaples or proof.
It's a little outdated, since C++11 fixes some problems, and introduces some of its own.
So is there any point in that page in that case? I think not. New projects should use C++11 standard anyway.
>>11 web browsers, where every megabyte of memory and every cpu cycle is important LOL!
Name:
Anonymous2012-01-08 13:22
>>16
There are many problems with garbage collection. It isn't suited for most of the projects that C++ is good in.
Name:
Anonymous2012-01-08 13:26
>>19 New projects should use C++11 standard anyway.
And not be able to compile their projects?
Name:
Anonymous2012-01-08 13:28
Alternatives to C++:
Objective-C is much better than C++. And Apple has invented for the latest version of the compiler this nice automatic memory management that inserts free() calls (well, the ObjC release message) at compile time so you end with code without GC.
C# is good too. It compiles to native code using ngen.exe. But unfortunately it's controlled by Microsoft.
>>24 Objective-C
No, No, NO! HORRIBLE! Even C++ has nicer syntax.
C#
It's okay I guess... as a language. But the resulting program is slow because of the GC.
Java is shit.
Nah, just slightly worse than C#.
Name:
NIGGER2012-01-08 13:35
Why all da hate, mah niggaz? Learn to accept each other.
A hold tight all mini-van people
It name mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor yeah!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi go a whisper mi nuh fi go ketch a mini-van
Some a hold on pon mi shirt and some a hold on pon mi hand
Some seh tek this mini-bus home seh tek this mini-van
This one to westmoreland this one to portland
This ya one out to trelawny this one to st ann
And the quickest way fi mek a dollar inna dem hand ya know
Mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor tree!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi left from work with one intention
Mi fi ketch a mini-van and go to portland
I will need rest from midday come three young woman
One a hold on mi shirt and one a hold on pon mi hand
Mi haffi put down mi bag and stand up as a man
And tek di conductor dem my position
One a go a westmoreland and one a go a st ann
But my destination is to portland
Give thanks to di mini-bus association
Who set di jolly business out a action
Name mini-van people gone to jamaica
One driver a dozen conductor
Yeah! mini-van people gone to jamaica
One driver a dozen conductor yeah!
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi go a whisper mi nuh fi go tek a mini-van
Some a hold on pon mi shirt and some a hold on pon mi hand
Some seh tek this mini-bus home seh tek this mini-van
This one to westmoreland this one to portland
This ya one out to trelawny this one to st ann
And the quickest way fi mek a dollar inna dem hand ya know
Mini-van people gone to jamaica
One driver a dozen conductor ya know
Mini-van people gone to jamaica
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know hey
Now mi left from work with one intention
Just fi ketch a mini-van and go a portland
I will need rest from midday come three young woman
One a hold on mi shirt and one a hold on pon mi hand
Mi haffi put down mi bag and stand up as a man
And tek di conductor dem my position
Dem a go a westmoreland and one a go a st ann
But my destination is to portland dem name
Mini-van people gone to jamaica
One driver a dozen conductor
Where have all the jolly bus gone long time ago
Where have all the jolly bus gone I I I don't know
Dem have big one, small one, middle size one
Dem even a new one dem deh quarter million
Seh big one, small one, middle size one
Dem even have a one dem value quarter million dem name
Mini-van people gone to jamaica
One driver a dozen conductor
Mini-van people gone to jamaica
One driver a dozen conductor
Name:
Anonymous2012-01-08 13:36
>>26
Don't let the syntax scare you. It's a very nice language.
>>25
Why would anyone want to use that freetard shit?
Name:
Anonymous2012-01-08 13:55
>>25
So you would seriously recommend that a large project would try to use C++11 despite there being no compliant compilers yet? Not only that, you would recommend that a large project should rely on some bleeding edge unstable software that might or might not support parts of the language, and is untested?
Name:
Anonymous2012-01-08 14:16
>>28
But I enjoy coding in C++. C++ has better support and I really don't see any benefit in Obj-C compared to C++.
>>29
Because it's a good compiler. VC11 has pretty ok C++11 support as well.
>>19
No examples? What. Look at the rest of the FQA. So is there any point in that page in that case? I think not. New projects should use C++11 standard anyway.
Most of the points are as valid as ever, and, as I said, C++11 introduces flaws on its own.