Quote:Original post by NotAYakk 1> #define FORWARD_DECL #include ... #undef FORWARD_DECL to get the forward declairations from a bunch of header files.
2> Primitive generic code tricks. Having a math library that works on doubles or floats or ints depending on what preprocessor tokens you define before #including it.
Quote:Original post by smitty1276 The "list of expressions to be evaluated" would look like valid c++ code (whereas the current incarnation does not). The for statement takes (expr list; bool expr; expr list), for example. My point with the initializers is that they were just kinda thrown in and have no relation at all to any other syntax in the C++ language. Assigning a value to a variable shouldn't look like a function call, unless that is what assigning a value to a variable looks like in the language.
Quote:Original post by smitty1276 The "list of expressions to be evaluated" would look like valid c++ code (whereas the current incarnation does not). The for statement takes (expr list; bool expr; expr list), for example. My point with the initializers is that they were just kinda thrown in and have no relation at all to any other syntax in the C++ language. Assigning a value to a variable shouldn't look like a function call, unless that is what assigning a value to a variable looks like in the language.
You arn't assigning a value to a variable. You are constructing a variable. And thats what constructing a variable looks like.
C++ is full of clumsy design choices. Consider the half-dozen meanings for the const keyword, "=0" used to designate pure virtual methods, virtual inheritance, the interaction of function overloading and template specialization.
C++ is a jack-of-all trades language that makes lots of simple things hard and takes way too long to learn well. Still, it's the only game in town if you want both high level programming constructs (object-oriented, generic programming) and low-level control (manual memory management, pointer fiddling, etc..)
Quote:Original post by cypherx C++ is a jack-of-all trades language that makes lots of simple things hard and takes way too long to learn well. Still, it's the only game in town if you want both high level programming constructs (object-oriented, generic programming) and low-level control (manual memory management, pointer fiddling, etc..)
So, basically, C++ let's you have your cake and eat it, too, so long as you don't mind a fresh-from-the-oven pan on your lap and that the frosting is laced with a triple dose of ex-lax.
C++ is such a poorly designed langauge because it is not a designed langauge.
C++ is such a great language because it is an evolved langauge, survivial of the fitest, or at least - survivial of that which happened to hitch a ride with that which was fit.
C++ is like it is for the same reason humans are like we are, because it was good enough to keep us surviving and evolving ... male nipples and all.
Almost all langauges with a better design have at least one fatal flaw that makes them unfit for some area of development ... hence the reason C++ remains the only true completely general purpose language ... while many other langauges are arriving which are better at larger and larger subsets of its domain (Java, C#, Python, ruby and many others from its line of offspring, plus dozens of langauges not directly decended from C: LISP, Eiffer, Haskell, ...)
But not one of the designers of those langauges ever said - how can I do EVERYTHING at least as well as C / C++, and then do most things better. They all said how can I do most things better than C / C++ and forget the rest.
Of all the questionable areas of standard C++ design, how the hell is initializer lists even being brought up? Seriously. If those complaints are the best you can come up with, then you need to learn a bit more of the language.