-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stewart Smith wrote:
> 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?

3958.

1976 and 1982 are integers, not dates.

- -j
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknQG+cACgkQ2upbWsB4UtGwtQCbBQp8WlMm8GLBjxJSiqs/VyZB
dNMAn35KKXx1+XEL8iC9OhavFpWhc707
=sILL
-----END PGP SIGNATURE-----

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to