Advertisement

OMG C++ sucks !

Started by September 20, 2010 07:38 PM
49 comments, last by Way Walker 14 years, 1 month ago
OK, I haven't really touched c++ for the last few years on anything more serious than a library compile, mostly because I switched over to C# for my projects and my last job wasn't programming.
So the idea I had a few weeks ago was to start a opensource project that would provide a odata interface on top of a NoSQL database MongoDB. The Entity model seems a perfect fit for Document database in functionality.
I chose C++ because MongoDB API for C++ is native (project is written in c++) while C# ones (multiple implementations) weren't very stable last time I tried them and I didn't want to go trough the ASP.NET because FastCGI seemed faster/more portable. Plus I liked the idea of using boost spirit for writing query parsers and using templates, fastcgi and c++ in general would probably grant performance advantages.

So I created a empty project, added a precompiled header included the external libraries (boost spirit/pointer/filesystem/etc., stl, pugixml, mongo api) and OMFG it took forever to compile, I'm too lazy to actually measure, but it's still measured in seconds :), for a empty project, and the precompiled header took even longer to compile. But that's irrelevant compared to the suck of the code completion, and VS kept eating more and more ram, until it outgrew a Firefox 2 process on a bad day. I have AMD5050e (x2) and 2gig of DDR2, so the PC is not really that bad (it's far from the top PC but still compared to the crap certain people are using). VS is 2010 (the "new 6") express. Basically intellisense is so slow it's beyond useless. Then I got reminded of the idiotic C/C++ include system, no modules that is. I never forgot what I had to do but actually doing it after coding in C# for the last few years is painful at least. And the preprocessor crap like include guards - bleeding my eyes ! And don't you just love to predefine your classes all the time... Oh and missing the LINQ all the time shouldn't even be mentioned, boost lambda doesn't even come close in elegance.

So I'm going back to C# and .NET API's for Mongo. I might even reuse .NET oData/CSDL implementation components if I can, I need to look in to it. I'll use Mono to take care of the portability issue.

Anyway this rant has no significant point, other than to share my rude awakening regarding the actual usability of C++ compared to C# and potentially start a flame with someone who hasn't moved on, mostly cause I'm bored :).
More importantly I think it's funny how two years ago I would have swore that the cosmetic stuff in C# isn't worth it, how tools aren't that important, how the template meta programing is superior to reflection and a bunch of other arguments I wouldn't even dream of making right now. Thumbs up for C# and Microsoft !
Yea... C++ isn't C#...

Quote: my rude awakening regarding the actual usability of C++ compared to C#

You might want to talk to Rubysts or Pythonistas regarding usability of C#.

At least with MongoDB you'll be web scale regardless of language.
Advertisement
Quote: Original post by RedDrake
Anyway this rant has no significant point, other than to share my rude awakening regarding the actual usability of C++ compared to C# and potentially start a flame with someone who hasn't moved on, mostly cause I'm bored :)

So you openly admit you might start a flame war should the opportunity arise (which it undoubtedly will)...

ITBL.

But yes, if you think C# is usable, try Python. In another two years you might just be saying the same things about C# as you are about C++ :)
Nah, I use python as well (longer than C# in fact), but I just find static typing really helpful in complex scenarios/building the architecture and not just the functionality. IDK is this due to the habit, but static typing helps me break down the complexity in to loosely coupled peaces and formalize/abstract concepts. (my) Python mindset is more getting stuff done right now, with off the bat approaches, fix as you go. Which is good until I get stuck and/or need to rewind :).

And the tools (IDE/Debugger) are better.
Quote: Original post by Zipster
ITBL.


Ban.
Going from playing with Python in interactive mode, C++ is truly painful when it comes to compile times. (A page or two of code for a simple OGL examples needs about 5-10 seconds from the time I hit compile/run till I see pretty pictures,...)

Do you go get yourself a sandwich when doing a total compile on a large project or something?
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Advertisement
Although there are some valid reasons C++ sucks, 65% of your complaints (forever to compile, precompiled headers sucking, code completion bad, ide using ram, intellisense being slow)

are actually about a particular implementation of C++ and its associated IDE as opposed to legitimate complaints about the language standard itself. I assure you that microsoft does NOT have a monopoly on C++ compilers or IDEs in the real-world.
I would say that the poor (dated) design of the language prevents them from implementing anything on the level of C# quality.
I've used GCC and Eclipse and Netbeans before, I remember thinking they were slow, code completion sucked even worse, in the days when I was using VC++ as a reference for fast/good. Maybe that changed ?
I do miss some of the template meta-programming from C++, but dear lord does it take so much less code to express the same thing (for all practical purposes) in C#. Every time I have to do something non-trivial in C++, I feel like I'm writing the compiler a damn novel and often getting one in return (see template error hell).
Quote: Original post by Steve132
Although there are some valid reasons C++ sucks, 65% of your complaints (forever to compile, precompiled headers sucking, code completion bad, ide using ram, intellisense being slow)

are actually about a particular implementation of C++ and its associated IDE as opposed to legitimate complaints about the language standard itself. I assure you that microsoft does NOT have a monopoly on C++ compilers or IDEs in the real-world.

Language design can impact all these elements though. Choosing another C++ compiler isn't going to magically speed up your compile times: They're shitty in GCC and other compilers too.

Consider that the same IDE (Visual Studio) on a newer language (C#) manages to kick it's own ass in many of the categories mentioned (Compile times, intellisense). While these are obviously heavily affected by the implementation (e.g. VAX intellisense can kick visual studio's ass), to say the language in question plays no role in these factors (if only by affecting how easy/hard it is to implement correctly and efficiently) would be absurd. As such, I'd consider them to be quite legitimate complaints about the language standard itself, even if they are also complaints about the implementations. Shared blame, as it were.

This topic is closed to new replies.

Advertisement