Possible to learn without education? (54)

36 Name: #!/usr/bin/anonymous : 2008-04-29 04:51 ID:mGTY1Ydf

>>34

Your lack of reading comprehnesion is showing. What I described is what the professor wanted us to do. I contend that it is incorrect.

To output a simple calendar for a month you only need to know 2 things. What day of the week to start with (the first of that month). And how many days the months has (if 4 or 6 or 9 or 11 then 30 else if 2 and also leap year 29 else 2 28).

That is 2 simple algorithms (1st day of month and leap year). There is no need for an array.

The only purpose the array served is to give you the 1st day of the week offset by counting the number of 0 or null values from the first array element. That isn't an appropriate use of an array.

Or less stupid, but still stupid is to make an array of 12 elements, filling each with the number of days for that month. Which is stupid because that information will never fucking change except for Febrary, and getting the number of days for Febrary given a year is trivial.

I am being led to believe 2 things, some of you have had a similar assignment and completed it in a fasion similar to this thinking that approach was not stupid. And/Or you seriously don't understand why the professors approach is fucking terrible.

And while this was an acedemic exersice, and was an exescise in the real world that even fewer of you would use a decent date library and not have to code any of the algorithms yourself because someone has already done the fucking work for you.

I don't see how the discussion here is any better than 4chans /prog/

This thread has been closed. You cannot post in this thread any longer.