Re: prefixes and namespaces?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Julio C. Galaret Viera wrote:
> 
> In my opinion it is not a good idea to prefix those functions.

Ok, noted as a vote no prefix.
 
> Neither is good to have so many functions like ...add_days, ..add_minutes,
> weeks,
> months and so on.
> 
> It would be enough to have an ADD function where you set the interval (year,
> month, week, day...):
> For example,
> - add 30 days: ..._ADD(DAY, 30, mydate or mydatetime)
> - add 1 week:  ..._ADD(WEEK, 1, mydate or mydatetime)

There are two methods for adding/subtracting. you saw them both add_seconds and
add_days. They can be used to subtract by doing add_days(-10....).

The reason there are those two is due to simplicity. Adding seconds allows you
to easily manipulate time. For instance, 3600*5 would add 5 hours. Adding days
allows you to easily manipulate a day.

As for adding weeks, months, etc... That gets very difficult because what is a
month, for instance? The average is 4.3 weeks, but that's an average. I think in
most programs you don't wind up adding in intervals of weeks, months, etc... It's
possible. But you could use, if you wish, add_days(7*4.3...) and add months,
weeks, or whatever you wanted.

So, we did try to make things as minimal as possible by adding just two
functions, add days and add seconds, as to work well with manipulating times and
dates.

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu