in reply to OO 2 death?

From reading your additional posts about the constraints placed upon how you had to do this project: This may sound a bit harsh, but I'm sure there are others here thinking it.

/me straps on his nuclear accelerated flame thrower...

Either the professor was trying to keep you from succeeding at this project on purpose, or he is a screaming moron.

You had to create a separate type of object for each day of the week? As jeffa rightly points out, you should make a 'day' object and then instanciate one for each day of the week. Why have different classes? The last time I checked Monday and Tuesday were not so ratically different that they would require two different types of objects. One of the guiding principles of OO design in the first place is to make a object to represent some number of like things. Days of the week are most certainly like things.

As for program size limitations. I have never, never, NEVER been told that my program couldn't be over a certain number of lines. My professors were concerned with 1) does it work 2) is it designed well 3) is the code maintainable and well documented.

/me loans flame thrower to Cestus....you'll be needing this the next time you go to class.

Choose the right tool for the job. At this point you may not know what the right tool is, but it seems like you're starting to see. There are some times when OO is the right way. There are some times when OO isn't. But there is never a time when a poor design OO or otherwise is the right way (especially if thrust upon you).

When in doubt, seek other's opinions...your professor isn't always right.

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Replies are listed 'Best First'.
Re: Re: OO 2 death?
by Cestus (Acolyte) on Dec 10, 2001 at 18:50 UTC
    mmm .... flamethrower. However, I do own a sword - all I have to do is sharpen it and remove the safety tip (for all you fencers, it's a practice foil (not electric) with a long belgian pistol grip). A lot of what my prof seems to preach is based on this Java course he took, and here I quote "I lost all of my marks because I did not properly comment the purpose of each variable"? At my workplace I have been asked to redesign code that goes on for hundreds of lines sans comments. He also said that his university prof limited the size of his classes to at most two pages. I think the problem is that my teacher is not very intelligent in the first place, and then he went to take a university course with a crazy prof. You guys are right, the splitting up the week thing should be totally unenecessary, but to him it is - otherwise how could we get Monday different from Tuesday! Why would we? It's only going to get worse now, however - I'm adding on security measures, which will, of course, have to be placed into modules as well, and some other stuff which will have to be modularized. As it stands right now, I've got one cgi and 11 module files. One is a cgi parser (CGILite), 6 are for the days of the week, 3 are for sports, and one is for generating hyperlinks. If I were to use OOP for real, there would be a total of 4 modules - one for a day of the week, one for a sport, one for making hrefs (it's actually kinda handy - what OOP should be) and the CGI parser. Like I said, I'll try and get that code up on my scratchpad, but I'm kind of distracted by the prospect of upgrading my sys right now (P4 ..... drool ......)

    Cestus

    Microsoft and Shinra are the same. They're both killing the planet.