|
Re: Why?
|
Posted: Apr 13, 2005 11:17 AM
|
|
>Why are smart people attracted to C++? I concluded that >its because C++ itself is just the damndest puzzle. Like >chess, the number of permutations is astronomical.
Personally, I'm attracted to it for not at least the powerful abstractions it gives you, and the resulting size of the design space. In comparison, most other languages seems either rather simple (so your code has to be complex, instead, or having huge libraries), or "one size fits all"-abstractions ("everything is and object", "everything is a function", etc.). I like that C++ doesn't enforce a particular programming style or paradigm on you, and offers several, as they are useful for different purposes.
>In order to understand any single line of a C++ program, >you must understand the entire program. You must know what >operators are overloaded, what type conversions might be >performed, what all of the single argument constructors >are that are not marked explicit, any operator type >methods, which things are passed by value vs reference, >etc.
I've heard this complaint from many C++ critics. You may approach it from the "wrong" angle: If you approach a C++ program with the mindset that you want to know every detail of what's going on there, then you're probably better off with something like C, which provides a much closer one-to-one mapping between source code and generated code. However, one point with abstractions is that you don't _have_ to know every little detail (even though you can find out, if you want to), to understand the code, and in fact, if you had all the zillion details on the same level of abstraction, it could be very hard to see what the code - in total - actually did.
Take this line:
std::cout << "Test";
This writes the line "Test" to the console. Is that hard to understand? Do you need to know that the "<<"-operator is overloaded, and that "std::cout" is an object, to write the above? Not really. Thus, you can concentrate on what you want to accomplish, rather than how it is implemented. And C++ is great for building abstractions.
>The addition of a single method can radically change the >behavior of the entire program. Thus, I concluded, C++ >does not scale to large projects well.
People with very large systems in C++ will likely disagree with you... Take applications like Microsoft Office, for example.
Have you found a language that you found to be better for this, in your opinion?
Regards,
Terje
|
|