If your only example to show C++ verbosity fails to compile and is also patently wrong, you are not making a good point. (The constructor is private, the variable naming prevents short accessors such as Rectangle::width()). Better:
struct Rectangle {
double x,y, width, length;
};
int main()
{
Rectangle r = {0., 0., 10., 10. };
return 0;
}
This even compiles in C++03. If you really insist on private members,
you will need initializer lists and some changed member names.
The small example error has been worked around with for years by
simply placing the constant on the left side of the comparison. Not
pretty, but effective.
I agree with the general point, though. A functional style can make
C++ much more efficient. It is also the only way to do template
meta-programming and everybody who tries to go into that direction can
benefit from learning Haskell.
I should have mentioned those articles. They are a great example of Haskell influencing a C++ programmer. Although this article might show what the average C++ programmer thinks `using the type system`, `verbosity` and `influencing their style` mean.
struct Rectangle { double x,y, width, length; };
int main() { Rectangle r = {0., 0., 10., 10. }; return 0; }
This even compiles in C++03. If you really insist on private members, you will need initializer lists and some changed member names.
The small example error has been worked around with for years by simply placing the constant on the left side of the comparison. Not pretty, but effective.
I agree with the general point, though. A functional style can make C++ much more efficient. It is also the only way to do template meta-programming and everybody who tries to go into that direction can benefit from learning Haskell.