On Fri, Mar 27, 2009 at 11:14:32AM -0700, Monty Taylor wrote:
> Stewart Smith wrote:
> > On Thu, Mar 26, 2009 at 10:42:24AM -0700, Eric Day wrote:
> >> It's nice knowing what type of var you are referencing in code without
> >> having to look at the class definition.
> >
> > 176% agree.
>
> 95% agree... it would be 100%, but I don't think we need to go Hungarian
> or anything.
certainly not. Of course, functions should be at most a screenfull long,
so you can always see what type everything is.
> > If what code does is not obvious by looking at it, it's crappy code
> > (this is why operator overloading is the root of all evil).
>
> To be argumentative though...
>
> Operator overloading isn't always bad. It's pretty much required for
> efficient use of some STL algorithms. And I'd argue:
>
> class Date
> {
> Date& operator+=(const Date& arg)
> {
> my_special_internal_date_value +=
> arg.my_special_internal_date_value;
> return *this;
> }
> };
>
> should cause no problems, given that you are making the + operator
> behave like the plus operator in exactly the way you'd expect a +
> operator to work.
But what is 1976 + 1982?
ESILLY seems like a possible result... :)
--
Stewart Smith
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp