Talk:Calendar: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎Improving the task description: Bah; fluffed the paste!)
Line 6: Line 6:


The task description includes these statements:
The task description includes these statements:
Test the calendar by generating a calendar for the year 1969 on a line printer of the time with a width of 132 characters.
:Test the calendar by generating a calendar for the year 1969 on a line printer of the time with a width of 132 characters.
Ideally the program will generate well formatted calendars for any page width from 20 characters up.
:Ideally the program will generate well formatted calendars for any page width from 20 characters up.
Kudos (κῦδος) for routines that also correctly transition from Julian to Gregorian calendar in September 1752.
:Kudos (κῦδος) for routines that also correctly transition from Julian to Gregorian calendar in September 1752.
While generating a particular year is fine, a Real Programmer would not have written their calendar generator to handle arbitrary widths of display. Instead, it would have either produced for 132-char wide line printers or 80-char wide terminals. In this day and age, nobody's got line printers any more so formatting for an 80-char terminal is what we must put up with. Given that, I propose that the task should state that the calendar should be tested by generating a calendar for the current year suitable for an 80-column device. Adaptation to other widths, other years and other languages are all to be extra-credit items. –Donal Fellows 08:34, 4 June 2011 (UTC)
While generating a particular year is fine, a Real Programmer would not have written their calendar generator to handle arbitrary widths of display. Instead, it would have either produced for 132-char wide line printers or 80-char wide terminals. In this day and age, nobody's got line printers any more so formatting for an 80-char terminal is what we must put up with. Given that, I propose that the task should state that the calendar should be tested by generating a calendar for the current year suitable for an 80-column device. Adaptation to other widths, other years and other languages are all to be extra-credit items. –[[User:Dkf|Donal Fellows]] 08:36, 4 June 2011 (UTC)

Revision as of 08:36, 4 June 2011

Switch-over Complexity

Surely the date of switchover between Julian and Gregorian calendars is locale specific? For example, getting the rules right for Sweden is… “interesting” given that they tried to do the switch slowly, got distracted by a war, and then decided to switch the rest of the way at once. –Donal Fellows 13:53, 31 May 2011 (UTC)

Yes. And this reminds me of easter. --Rdm 18:22, 31 May 2011 (UTC)

Improving the task description

The task description includes these statements:

Test the calendar by generating a calendar for the year 1969 on a line printer of the time with a width of 132 characters.
Ideally the program will generate well formatted calendars for any page width from 20 characters up.
Kudos (κῦδος) for routines that also correctly transition from Julian to Gregorian calendar in September 1752.

While generating a particular year is fine, a Real Programmer would not have written their calendar generator to handle arbitrary widths of display. Instead, it would have either produced for 132-char wide line printers or 80-char wide terminals. In this day and age, nobody's got line printers any more so formatting for an 80-char terminal is what we must put up with. Given that, I propose that the task should state that the calendar should be tested by generating a calendar for the current year suitable for an 80-column device. Adaptation to other widths, other years and other languages are all to be extra-credit items. –Donal Fellows 08:36, 4 June 2011 (UTC)