Reply to Re: Best Coding Practice

Your name:

Reply:


Posted by Steve on 08/24/07 21:44

| For the record, I think my second post has been terrible
| misinterpreted. Product is not an extension of orders, orders contains
| products in an array.

no, i got that.

| And Steve, I'm by no means saying you're wrong in claiming that OOP
| would truly be the BEST, way to go. If it were up to me, I would be
| doing exactly what you're saying. However, I came into this project
| four months ago, after it's been under constant development with
| continuous scope creep for the last 3-4 years. And the programmers
| before me, as far as I can tell, don't understand OOP nearly as well
| as I do, and that offsets them either further from you, because I can
| concede that you probably do know more about OOP than I do.

then you'd be giving me more credit than i'm due. ;^)

listen, i know about dead-lines and costs and don't even get me started on
scope-creep. i've been consulting on a project that i originally estimated
and priced as a three month project. now it's two years later...at least
they keep my extra income level high.

| All they care about is that it works. I know, I know...it's
| the wrong way to look at things, and I've made my best efforts to
| persuade others of that, but it's unfortunately vain efforts.

yeah, that's usually the way it goes. plus, the more times you try to help
open their eyes to potential problems they will most assuredly pay for down
the road, the more the see you as one who complains a lot...nothing more.

| As for the specific circumstance we were addressing in the first
| place, I'm not trying to say that I don't want to use OOP simply
| because I think it's going to make things more complex for me, or
| something like that; I don't want to use it because I don't think it's
| going to add anything to make any feasible solution any better.

it works out that way sometimes too. that would be oop-creep when a more
simple solution lies at the fingertips of a few well written lines of code,
but is otherwise written to match oop. it is key to recognize this, which
you have it seems. when you sit down to write or rework code, that's the
question (of many) i ask myself. what's the best way to express a solution
that is stable, maintainable, and will last over the long run? (oh, and it
has to work, not cost much, and be done yesturday)

| I would still need two arrays to distinguish products

well, no, you wouldn't. using oop, you can tell the object type of $product.
if 'free' extends the product class, then you can tell by its
type...'freeProduct' (or whatever). you can then branch your 'order' logic
based on that if you need to do something special with 'free'.

| because the
| database is structured so poorly, and redundantly, which I probably
| should have made more clear in the first place, but I really feel that
| this conversation is leaving the context of the original question I
| was trying to have answered.

well again, if you oop things, you can isolate one area of code to
consolidate the interactions with the db: one set of code to manage it, one
set of code to maintain it. that way, further development is kept clean and
not tied to poorly/redundantly designed db structures. if not contained this
way, you'll see the code become even more convoluted that the db and people
will copy and paste the already shitty code into new sections where it will
be modified slightly for whatever purpose need...propgating one nasty end
product.

hey, didn't mean to seem like i was getting on to you or anything like that.
i guess i was just preaching to the choir. ;^)

cheers

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация