|
Posted by Tyno Gendo on 09/28/07 15:43
Thanks Willem! Going to be a long journey :-)
Willem Bogaerts wrote:
>> Thanks Willem, I'll have to have a further play with classes/patterns
>> and look for more examples. The point is, I'm trying to justify using
>> them to myself over functional programming, at the moment I try building
>> class based projects and most of the time they just end up being more
>> confusing, taking longer and not really adding much benefit.
>
> One word of advice: patterns are not holy. Don't try to force your code
> into a pattern. Even if an existing pattern would be appropriate, you
> might choose the wrong one. Read about patterns and see _why_ they are
> useful. You may very well come up with a number of patterns of your own.
> Some programming languages even create a need for them.
> For me, patterns emerge from my code. And as my code is not that unique,
> many patterns are recognizable from textbooks as well. Reading about
> patterns helps you to identify them if they emerge. But if they don't
> emerge, no problem.
>
> And do not be afraid to change things later. No program is perfect and
> even if it were today, it wouldn't be tomorrow. If I may suggest a good
> read, read "refactoring" by Martin Fowler. It features a nice "let's put
> a class statement around this" program and it shows how to morph it into
> a real object-oriented one.
>
> Good luck,
[Back to original message]
|