On 14/09/2006, at 11:22 AM, O Plameras wrote:
You've said "let's overload plus for time to mean we add a whole
day".
Andre and myself have said "picking 'one day' for what adding an
integer to
a time means is arbitraty and unobvious to anyone but the person
who first
decided it."
Then ask, if unobvious; don't jump to conclusions.
This is exactly _why_ your code is bad. Writing
time+1
is unobvious about the behaviour, for the reasons I mentioned above.
Since it's unobvious, I cannot jump to conclusions. I have to look
up the documentation for what the overloaded + operation does (or ask
_you_ what it does and potentially knock you out of a coding zone,
which is even worse).
I'm strongly of the opinion that time types are not good types to
overload
like this.
Value judging is a debate that never ends with no winners and/or
losers. I'll not engage you in that.
This is not a value judgement with personal bias. This is an
objective judgement about code readability -- although there's an
assumption that you do care about code maintainability and
readability. I am saying that you are wrong in choosing overloading
for the purpose that you have mentioned, because it makes the code
less maintainable. This is something that can be objectively
measured: have a third party come along, read the code, and see if
they can figure out what it does.
But it's also, unjustified to make value judgments (cynism or bad
faith) especially as to the character or motives of programmers
like Guido van Rossum when it's so negative. Again, GvR is right
and Andre is'probably' right depending on the context of the
problem being solved.
Sorry, Guido van Rossum proved to me that he didn't know his
programming language theory (PLT) when he confused strong typing with
static typing in an interview several years ago. This is basic PLT
knowledge, and is something that anyone who takes a programming
language course at university will get correct. He certainly does
know the difference today, but I worry that he didn't know the
difference when Python 2.0 was out.
--
% Andre Pang : trust.in.love.to.save <http://www.algorithm.com.au/>
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders