Re: Re: cvs: php4 /pear/Date Calc.php Calendar.php

From: Date: Mon, 16 Oct 2000 13:47:16 +0000
Subject: Re: Re: cvs: php4 /pear/Date Calc.php Calendar.php
References: 1 2 3 4  Groups: php.pear 
Request: Send a blank email to php-pear+get-386@lists.php.net to get a copy of this message
Here is a direct comparison of the current function name style vs. the studlyCaps style. I personally think its a bit more difficult to read, especially with cases like N_weekday_of_month (NWeekdayOfMonth), but I also agree with consistancy. Anyways, I'd like to hear your comments after comparing these: current style: function date_now($format="%Y%m%d") function is_valid_date($year, $month, $day) function is_leap_year($year="") function is_future_date($year,$month,$day) function is_past_date($year,$month,$day) function day_of_week($year="",$month="",$day="") function week_of_year($year,$month,$day) function julian_date($year="",$month="",$day="") function quarter_of_year($year="",$month="",$day="") function begin_of_next_month($year="",$month="",$day="",$format="%Y%m%d") function end_of_next_month($year="",$month="",$day="",$format="%Y%m%d") function begin_of_prev_month($year="",$month="",$day="",$format="%Y%m%d") function end_of_prev_month($year="",$month="",$day="",$format="%Y%m%d") function next_weekday($year="",$month="",$day="",$format="%Y%m%d") function prev_weekday($year="",$month="",$day="",$format="%Y%m%d") function next_day($year="",$month="",$day="",$format="%Y%m%d") function prev_day($year="",$month="",$day="",$format="%Y%m%d") function default_century($year) function date_diff($year1,$month1,$day1,$year2,$month2,$day2) function days_in_month($month="") function first_of_month_weekday($year="",$month="") function begin_of_month($year="",$month="",$format="%Y%m%d") function begin_of_week($year="",$month="",$day="",$format="%Y%m%d") function end_of_week($year="",$month="",$day="",$format="%Y%m%d") function begin_of_next_week($year="",$month="",$day="",$format="%Y%m%d") function begin_of_prev_week($year="",$month="",$day="",$format="%Y%m%d") function get_calendar_week($year="",$month="",$day="",$format="%Y%m%d") function get_calendar_month($year="",$month="",$format="%Y%m%d") function get_calendar_year($year="",$format="%Y%m%d") function date_to_days($year,$month,$day) function days_to_date($days,$format="%Y%m%d") function N_weekday_of_month($occurance,$day_of_week,$year,$month,$format="%Y%m%d") { function date_format($year,$month,$day,$format) function get_year() function get_month() function get_day() function get_month_fullname($month) function get_month_abbrname($month,$length=3) function get_weekday_fullname($year="",$month="",$day="") function get_weekday_abbrname($year="",$month="",$day="",$length=3) studlyCaps style: function dateNow($format="%Y%m%d") function isValidDate($year, $month, $day) function isLeapYear($year="") function isFutureDate($year,$month,$day) function isPastDate($year,$month,$day) function dayOfWeek($year="",$month="",$day="") function weekOfYear($year,$month,$day) function julianDate($year="",$month="",$day="") function quarterOfYear($year="",$month="",$day="") function beginOfNextMonth($year="",$month="",$day="",$format="%Y%m%d") function endOfNextMonth($year="",$month="",$day="",$format="%Y%m%d") function beginOfPrevMonth($year="",$month="",$day="",$format="%Y%m%d") function endOfPrevMonth($year="",$month="",$day="",$format="%Y%m%d") function nextWeekday($year="",$month="",$day="",$format="%Y%m%d") function prevWeekday($year="",$month="",$day="",$format="%Y%m%d") function nextDay($year="",$month="",$day="",$format="%Y%m%d") function prevDay($year="",$month="",$day="",$format="%Y%m%d") function defaultCentury($year) function dateDiff($year1,$month1,$day1,$year2,$month2,$day2) function daysInMonth($month="") function firstOfMonthWeekday($year="",$month="") function beginOfMonth($year="",$month="",$format="%Y%m%d") function beginOfWeek($year="",$month="",$day="",$format="%Y%m%d") function endOfWeek($year="",$month="",$day="",$format="%Y%m%d") function beginOfNextWeek($year="",$month="",$day="",$format="%Y%m%d") function beginOfPrevWeek($year="",$month="",$day="",$format="%Y%m%d") function getCalendarWeek($year="",$month="",$day="",$format="%Y%m%d") function getCalendarMonth($year="",$month="",$format="%Y%m%d") function getCalendarYear($year="",$format="%Y%m%d") function dateToDays($year,$month,$day) function daysToDate($days,$format="%Y%m%d") function NWeekdayOfMonth($occurance,$dayOfWeek,$year,$month,$format="%Y%m%d") function dateFormat($year,$month,$day,$format) function getYear() function getMonth() function getDay() function getMonthFullname($month) function getMonthAbbrname($month,$length=3) function getWeekdayFullname($year="",$month="",$day="") function getWeekdayAbbrname($year="",$month="",$day="",$length=3) Chuck Hagenbuch wrote: > > Quoting Monte Ohrt <monte@ispi.net>: > > > This can be done.. although how important is it? Is this a rigid PEAR > > code style that should be followed? My personal preference is to use > > last_day_of_month instead of lastDayOfMonth, it just easier to read when > > the words aren't all run together. > > Well, it's something that's in the current standards doc, and I happen to think > it's a good idea - it's just consistency. If we make sure that the entire PEAR > class tree follows the same method naming conventions, then it'll be easier for > people to remember what methods are called. Code using PEAR stuff will also look > more consistent, also. > > That's my argument for. Other thoughts? > > -chuck > > -- > Charles Hagenbuch, <chuck@horde.org> > must... find... acorns... *thud* > > -- > PHP Extension and Add-on Repository (PEAR) mailing list. > Documentation can be found at http://pear.php.net/doc/pear.html > To unsubscribe, e-mail: php-pear-unsubscribe@lists.php.net from the > mail address you subscribed with. -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.pear (#386) next »