Linked by David Adams on Sat 11th Oct 2008 16:48 UTC, submitted by IndigoJo
General Development Eric Raymond is working on an essay, putatively titled "Why C++ Is Not My Favorite Programming Language". In his announcement, he calls it "an overcomplexity generator", "bloated, obfuscated, unwieldy, rigid, and brittle", and alleges that these characteristics appear in C++ applications also. I contend that many of the complaints about C++ are petty or are aimed at specific libraries or poor documentation and that many of the features commonly regarded as unnecessary (and excluded from intended replacements) are, in fact, highly useful. C++: the Ugly Useful Programming Language
Thread beginning with comment 333406
To read all comments associated with this story, please click here.
C++ using the STL, SQLite, and Poco is rich
by pcunite on Sun 12th Oct 2008 14:34 UTC
pcunite
Member since:
2008-08-26

C++ using the STL, SQLite, and Poco is simple and creates readable code. People and corporations have come to late to tell me C++ is hard, unusable or too complex.

To everyone else go ahead a learn a new language every 5 years while I perfect the one that runs on everything.

Reply Score: 2

ba1l Member since:
2007-09-08

Never heard of Poco before. That looks pretty nice - essentially the same kind of stuff that's available in .NET and Java's class libraries, but is missing from C++'s standard library. I'll have to look into that one.

I'd probably add Boost to that list. Much of the functionality I use from Boost is also present in Poco (some seems to have derived from Boost, in fact), but Boost contains so much more.

There's also a lot of good stuff in the C++0x proposal, whenever that gets finished and widely implemented. Much of the additions to the standard library are already available in the latest versions of GCC and MSVC, or through Boost (where many of the additions originated) otherwise.

All we really need is a really good, portable UI toolkit that can be used seamlessly with all those other modern C++ libraries, without either using old-style C++ or even C code (Gtk, Win32), or pulling in their own implementations of everything (Qt, MVC).

Reply Parent Score: 2

pcunite Member since:
2008-08-26

C++ is a systems language that you can pretty much build anything. It allows for both object orientated programming as well as the needed procedural style programming. It's beauty (if used properly but not always done however) is to procedurally use objects.

Consider the code sample below and tell me this is not very simple:






********************************
class Paper
{
private:
std::string Color;
std::string Text;

public:
Paper();
~Paper();

// Getters
std::string GetColor(void);
std::string GetText(void);

// Setters
void SetColor(std::string Color);
void SetText(std::string Text);
};

// Create some blank paper. Everthing is free inside the computer!
Paper1 Paper;
Paper2 Paper;

// Set some info about each piece
Paper1.SetColor("White");
Paper1.SetText("Buy some eggs and Milk\nDon't forget the cheese!\n");

Paper2.SetColor("Green");
Paper2.SetText("You may have already won one Million Dollars!\n");

// Create a container to hold paper and put some paper in it.
std::vector<Paper> MyTrashCan;
MyTrashCan.push_back(Paper1);
MyTrashCan.push_back(Paper2);

// See what is in the Trash can. Thus:
for (size_t i = 0; i < MyTrashCan.size(); i++)
{
//Print out to the screen or over a TCP connection
std::cout << MyTrashCan[i].GetColor();
std::cout << MyTrashCan[i].GetText();
}

********************************

Reply Parent Score: 2

sergio Member since:
2005-07-06


// Create some blank paper. Everthing is free inside the computer!
Paper1 Paper;
Paper2 Paper;


Mmmm... compile time error. The right way would be:

Paper Paper1;
Paper Paper2;

BTW, I don't like C++ syntax at all... It's verbose like Java and ugly like Perl. The worst of two worlds. ;)

Reply Parent Score: 2

luzr Member since:
2005-11-20

Problems will start if there is anything else than single Color and Text attributes. What about:


class Paper
{
private:
std::vector<std::string> Text;
};


and the existing code will still work, but will be much slower than Java.

But that is not a problem of C++ core language, but STL...

Reply Parent Score: 1

StaubSaugerNZ Member since:
2007-07-13


//Print out to the screen or over a TCP connection


Your line above shows the flaw in C++. How do you get the TCP connection? While one could argue the the C++ language is ok what it's missing out on are standardised cross-platform libraries for things outside of data structures.

Libraries is the strength of Java (and .NET somewhat, if all you care about is the desktop on x86 architectures).

Ok, so maybe you don't need sockets, so where are the standardised cross-platform C++ guis (that don't need precompilers or macro magic). Or how about threading? When multiple threads own your Paper class who is responsible for cleaning it up? Where is the standard way of documenting the class for maintenance programmers new to the system? (sure doxygen is great, but it ain't standard on C++ projects).

Despite the power of C++ as a language it is weak in areas such as legibility, cross-platform standard libraries, and thread-safe programs that can be maintained by mortals (not just the 'elite' that visit sites like this). This is why C++ has been marginalised by Java and the much-simpler C (still used for systems programming).

Here are the statistics:
http://www.langpop.com/
http://www.tiobe.com/index.php/content/paperinfo/tpci/

Sure C++ and C# are used (and admittedly are the right fit for some projects), but not as heavily as many fanboi would like you to think.

Reply Parent Score: 3