You have a stupid teacher. I completely sympathize. I have had to deal with the same problem.
While there are good reasons to limit a function to a page, there is no good reason to so limit an entire module. Furthermore your teacher's insistence on separating out similar things in the name of "modifiability" is just plain silly. What you are doing is, as you discovered, guaranteeing spending a lot of time writing similar code. More code means more room for mistakes. Most code means that any change has to be made in more places, and the opportunity for doing so means more room for mistakes. More code that is very similar means that you will spend time doing cut-and-paste code. Cutting and pasting is a guarantee that if you catch a mistake, you are going to have a fun time trying to fix it in every other place where it appears.
Instead it is far better to find ways to put each piece of real information in as few places as possible (hopefully 1). That means gathering together similar things, having common execution paths, etc. This does not preclude any kind of later modification. In fact it makes it easier. Should you need to split things farther, you can do so later at no more work than it would be to do now. Should you need to reorganize or change common functionality, you will find that easier than it would otherwise be.
I therefore encourage you to look past the bad and counter-productive restrictions placed on you by your teacher, and continue (even if you have to do it on your own) learning how to program well, including how to code OO well.
In reply to Re (tilly) 3: OO 2 death?
by tilly
in thread OO 2 death?
by Cestus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |