Re: Why :: ? Why not : ? Why not . ? <- less clutter ?!?
On 2007-08-24 06:09, Skybuck Flying wrote:
Please quote the text you are replying to.
Making road signs round or square or triangular does not add or reduce
clutter.
The unnecessary :: () makes it definetly more harder to understand, write
and read it.
A good test would be:
Ask someone who is dislexies which one he prefers:
long Test::TimesOne()
or
long Test.TimesOne
Another example of C++ clutter is operator overloading <- horrible clutter.
Just remembering what clutter is needed to make it compile requires an
elephant's memory.
Yes, C++ might be a bit cluttered and a bit hard to read, but as Alf
explained there is an obvious reason for most of it. If you want an
language that is easier to read and understand there are many of those,
BASIC comes to mind. But then again, few of these simpler languages are
even close to C++ in popularity, or as powerful as C++.
It's true that most people probably never will get more than a basic
understanding of C++, and if you are dyslectic you'll have more problems
than most. But then again most people will never be fit enough to
participate in the Summer Olympics.
By the way, how do you mean that operator overloading increase the
clutter? I'd argue that it does exactly the reverse. Consider the
following two examples:
a = b * (c - d * e);
or
a = b.multiply(c.minus(d.multiply(e)));
The second example is what you get without operator overloading. I
remember when back in school I was implementing DSA using Java's
BigInteger (a class that can store arbitrary large integers). The
mathematical operations went over two lines and I'd was forced to spend
a lot of time to figure out why it didn't work (was a miss-placed
bracket). All the time I was wishing I was using C++ with overloaded
operators instead.
--
Erik Wikstr?m