Jamie Wilkinson wrote:

Uh, you're missing your own point.  It doesn't matter how many units you
want to increment by, the point is that "today + 1" is completely vague
about how many units of time that it's incremented by.  Vauge means that
humans will either read it and make assumptions, or spend their time looking
it up; either way it'll end up being unproductive.

Ok. So your point is it is vague. Well, yes it's vague by itself. In the context of
the whole code it is meaningful.

My 'value judgment' is I'll use a coding style which I believe is easy and quickly maintained. Sure, logical purity and coding elegance are what some tribe of programmers
enjoyed to pursue, but I belong to group that prefers 'pragmatism' rather
than 'purity' and 'maintainability' rather than 'elegance'.

Do you want "this_hour + 1" to also increment by a day, or by an hour?

No, absolutely not.

I've seen codes particularly in 'Ruby' that use this specific style of 'overloading'. So, obviously, the author of that 'Ruby' code made a judgement it's good idea
to do that.

You mentioned Python in your other post, too.

Both these languages provide operator overloading.  They do it because, as
was pointed out way back in the mists of antiquity at the start of this
thread, that sometimes it's a good idea.

You're trying to prove to us that it's a good idea, and we're agreeing with
you in principle, but the specific example you gave is a perfect example of
why it's *not* a good idea.


No, I'm not trying to prove to 'us' (or 'you') that it's a good idea precisely for the reasons that your 'us' value differs from 'mine' value. There are other people who would peddle their values as if these values are the only good ones; I have different values, because I say your judgment is good for you ( I trust your judgment) but I say that my judgment is good for me (It does not matter whether you trust it
or not).

So, in the general case, Python and Ruby and all other languages that give
you overloading, do so in order to give the programmer the ability to
decide -- but that is *not* an endorsement from Guido or DHH or Bjarne, or
anyone, that overloading is the right screwdriver for a nail.

Again, it does not matter. I use a coding style I'm comfortable with and from which the end results are acceptable to the end-users( more important than the programmer
himself).

There's no principle or 'absolute formula' to make a judgment. That's why it's
called 'value' judgment because it depends on one's value and values differ.

Sure, you're right here.

I value my code being readable and maintainable, so I won't use overloading
when it adds ambiguity despite it making things shorter to code.  That's my
judgement, and I stand by it.

Who tried to convince you otherwise ?

O Plameras
_______________________________________________
coders mailing list
[email protected]
http://lists.slug.org.au/listinfo/coders

Reply via email to