Re: vc or vc++??
Ben Voigt [C++ MVP] wrote:
I certainly prefer sin(x) over Math.sin(x).
Hmmm, how about std::sin(x)? I don't find that cumbersome but I too like the
distinction between calling a memberfunction and invoking a function from a
namespace.
95% of the time one of these "OOP languages" has a public static method in
the base library, it's a workaround for a missing language feature
(sometimes you actually need membership to get access to private members,
but that usually isn't the motivation, and C++ has "friend").
Yes, 'static' is used to escape a forced OOP style at least in the Java code
I have seen.
C++ can do it the OOP way like all those languages, but can also use
library-of-functions style when that's more appropriate, or template
metaprogramming, whichever suits the problem best. Although I guess if
functional programming is a better fit you're out of luck with C++.
TMP is a gross hack and produces barely readable code for otherwise very
simple things. I'd say the lack of metaprogramming is one big lack in C++,
and http://www.stepanovpapers.com/notes.pdf in fact agrees, providing
examples for a syntax. Hmmm, I remember first learning C and was very
surprised that the preprocessor couldn't do things like loops, too.
As far as functional programming is concerned, I don't really understand it.
The only thing I know about it is that functions or code can be treated
like objects. For example you can return them from functions and store them
in variables. This however is also achieved by boost/tr1::function.
What is also missing in C++ is lambda expressions and (maybe) local
functions. Using Boost.Lambda isn't really a good replacement, nor is a
static function of a local class.
Uli