|
Posted by Mike Willbanks on 05/10/05 04:55
> Generally, writing OO code does take longer than non-OO code, just as
> writing functions takes longer than doing something inline. The
> advantage come when you reuse the code, or, as in above, need to make
> changes to the back end.
Taking longer is a common misconception. It's the same thing with most
programming. The more you do it the less time it takes.
Also a class with structures I already have in place, I have a specific
way I write my objects. When I first started writing objects and trying
to find a way to make it as reusable as possible I was taking around 1
hr to write the class now that time is down to around 15 minutes.
Now when I look at that type of time I then look at how long it will
take me for a page that does not use my objects I have already written
and then just writing it all in one file and between using my reusable
code and creating one big file is a change from around 2 hours to 30
minutes.
The reason is that my reusable code has been tested many times, the
expected actions are tested and the limitations known. This way you do
not recreate the wheel.
But the same can be said for simple include files. I just like it
because of the difference in namespaces and I can use any variables
without cluttering the files and have to worry about using an existing
variable.
So I think that also needs to be looked at when using OOP. Is the
namespace :)
Mike
Navigation:
[Reply to this message]
|