This one time, at band camp, O Plameras wrote: >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.
I've been pretty clear. "today + 1" is not meaningful unless you are willing to put a giant comment next to it saying "this means we're adding a day", or being explicit in your types and writing "today + 1 day". *THEN* this sort of overloading makes perfect sense. >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'. I'm going to have to go ahead and disagree with you on maintainability. It's quicker to write the first time, but anyone else looking at it *has* *to* *know* that 1 in this context means 1 day, and you haven't at any point said "I have a honking great comment saying this right next to this line." >>Do you want "this_hour + 1" to also increment by a day, or by an hour? >> >> >No, absolutely not. No to which? No it shouldn't also incrememnt by a day? That's inconsistent! No it shouldn't increment by an hour? Why not? I'm only using an hour type now! _______________________________________________ coders mailing list [email protected] http://lists.slug.org.au/listinfo/coders
