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

c++ love it or hate it?

Name: Anonymous 2011-01-10 19:16

personalty, i love c++ whats your opinion on it?

Name: Anonymous 2011-10-10 2:29

>>68

Nine tenths of what this guy wrote is so crippled with prolix, obscure analogies and "deep" meaning ideas ("C++ is philosophically and cognitively unsound as it forces a violation of all known epistemological processes on the programmer"... what?) that the whole text becomes devoid of all sense, if there was any intended. The guy has no point to make; instead, he visibly wants to sound authoritative and deep (while, at the same time, he lazily forgets to proper capitalize words).

Unfortunately, that's what stains the programming communities: the programmer themselves. No language is good enough so that fond programmers won't behave as complete illiterate retards. (Some of them go even further in their ridiculous pretentions and attribute that to Asperger's, as Eric Raymond justifies in his famous "How to Become a Hacker" essay. I most deeply pity that guy.)

Curiously, this guy is from the Lisp realm, a supposedly (or rather claimed to be) distinct, enlightened space where more well selected people gather together. Yet, in my opinion, he behaves as badly as an emotionally impaired teenager writing suicide letters ("for more than a year after first exposed to C++ in a six-month project, I was actively considering another career"... oh wow!). From my experience, that's actually expected from the average cult-follower, which is somewhat why such (indeed good) languages acquire some strange, bad reputation among foreigner programmers.

In other words: again, the community propaganda is what defines better the reputation of a language than the language itself.

On to the topic. C++ has indeed a tough reputation as being an overcomplex, ill-designed language. It does have a number of important defects, a number which is actually much less than what is advertised, but which, in practice, makes the language usage difficult in certain scenarios. Compilation times are extremely long (though heavily ameliorated by using precompiled headers), compiler implementations are hostile to the programmer (confusing diagnostic messages, non-conformancies to the standard), complicated syntax which is difficult to master, and so on.

In my opinion, the most common mistake made by naive programmers, and the most common cause for criticism against the language, is that C++ is extense and difficult to master in its whole. That's a fact: C++11 has a 1300-page standard which encompasses a lot of syntax features and complex semantics. Nonetheless, the point of the language is not to "master" every aspect of it, or even worse, attempt to use every such feature in the same project. The language goal is to offer desired features to desiring programmers, in their particular cases, so that the programmer decides how to write his program in the best way.

Nonetheless, C++ has a number of interesting features. C++ has an interesting type system (which works, despite whiners who tend to always call out reinterpret_casts examples in order to argue it doesn't), some meta-coding features (templates, mixins), some support for object orientation (virtual dispatching, inheritance, polymorphism), error-handling through exceptions and, more recently, some functional programming support. Neither of these features are pristine-perfect; actually, many of them contains caveats and misdesigns, but most of them can be well circumvented with some discipline and practical knowledge. Small to mid-sized projects rarely touches C++ limitations in this aspect. Large projects employ pragmatic solutions (precompiled headers, modularization inside sub-libraries) for reducing the overall development complexity and gaining team productivity. Note that one of the most common denounced problems in C++ -- freestore memory management -- is actually rarely an issue; heap allocation is comparatively less used than stack allocation and, whenever it is used, programmers employ well-known tricks (shared and auto pointers) to handle them safely.

Even the C++ most idiosyncratic features have good practical usages. Templates are adequate for container libraries and type-generic functions. Multiple inheritance is a form of additively changing classes' behaviors, making them "be" several things at once, much similar to Java's "interfaces". References allow for pointer semantics when needed and without syntax issues (one can change from one to other when appropriate). Inner classes and namespaces elegantly wraps concepts inside a name or a class. "Friends" solve the very nasty problem of lack of modularization by roughly providing "package visibility" to (hopefully related) classes. Operator overloading increments semantics when used adequately, and so on. Good sense is imperative when using many of these features: a misused feature does not turn it into a design problem by itself, but the programmer's frustrations tend to aggravate bad feelings towards the language when problems arise.

Not that the decision of making C++ the all-in-one language is good, I particularly find that terrible. Even more, I believe "multiparadigm" languages are a priori ill-designed, since mixing different thinking processes inside the same syntax structure and execution environment is inherently bad. C++ programmers tend to have "idioms", which is a consequence of the forementioned fact: every C++ programmer (and thus every C++ program) has a particular trait, a projection of the programmer's known idioms in the source code, which in practice makes reading C++ a very complex task, and thus heightens the barriers of code integration and reuse.

In summary: C++ is not a (too) bad language, although it surely could be better (and C++11 did not evolve a bit in this sense). The main problem with C++ is that it gives a vast possibility of writing very bad and difficult-to-integrate code, and, what is worse, sometimes the community tend to regard such code as "expert" code (such as Boost, which is one of the most extreme abominations and ill-designed libraries known to me so far), but, again, this is community propaganda. On the other hand, C++ gives an adequate toolset for the programmer to drastically increase his productivity, at least when compared with other groundbase languages, such as C. Also, there are excellent frameworks for C++ (Nokia's Qt comes to my mind) that allows very quick development and deploy of extensively complex projects. Just look around: there are some brilliant (and beautiful) C++-written programs and libraries for use.

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