Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bad things about C++

Name: Anonymous 2007-02-09 4:03

Since the python thread was a smashing success, it's only logical to have a C++ equivalent. So list the bad things about C++. Constructive thread, please. I will get the ball rolling:

 * Segment faults.
 * Broken standard library.
 * One word, the forced indentation of code. Thread over.
 * Broken templates.

Name: Anonymous 2007-02-09 13:32

One of C++'s problems is that it has accumulated a lot of cruft.

Take the most powerful feature of C++: templates. Templates were never meant to be (ab)used the way they are now; their power was discovered, not designed. As a result, because backward compatibility cannot be broken, library developers are performing agonizing contortions to make these powerful libraries. SFINAE anyone?

Or take the far more mundane C strings in C++. They're easy to learn and create, but they're dangerous like hell. The proper way is to use the STL string library, but of course that's more to learn and boilerplate suddenly appears in the code. And since it's part of the standard, you can't extend the string class however you want, eg. to properly support unicode. It works most of the time with UTF8, but if you want to proper support, you'll need to make your own string class, probably using vector (<insert snide joke about the C++ community's stupid obsession with libraries instead of language features when these same libraries are frozen by the fucking standard anyway>).

And it goes on. C++ is damn powerful, but it needs a remake. Only problem is if you remake it, it's not longer C++. Me? I'm holding my breath for D, and seeing what Walter Bright and Alexander Alexandrescu can make.

Name: Anonymous 2007-02-09 14:00

>>21

It's not really a subclass persay as the string gets chars via a template parameter (basic_char or somesuch for the usual std::string if memory server).  Importantly, and not mentioned by >>19, the standard library also includes wstrings, which are basically just strings with 2-byte characters.

As far as handling unicode <i>correctly</i>, basically no library that I've heard of does.  What with the code points and pages and ability to combine multiple memory-level "characters" into one glyph, it's often even questionable what the definition of a "character" is.  Lots of libraries get it mostly right, though, and that's what you've got to go for. 

As long as you're not doing anything specialized with the wstring, the standard library ought to suit you just fine.  If you're doing specialized work with Unicode strings in nasty languages, though, you're going to have to go buy a library to handle it or write your own.  This isn't any different from any other library in any language, of course.  Standard libraries are widely useful, but not universally adequate, nor is it even possible that they could be.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List