Re: What design patterns do you usually use?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zoltán Németh wrote:
2008. 02. 29, péntek keltezéssel 14.28-kor tedd ezt írta:
At 4:36 PM +0100 2/29/08, Zoltán Németh wrote:
sure, all information belonging to an object is usually in a record of a
db.
but, you mean include('user_functions.php') automatically loads that
data? based on what? a global $user_id variable? if so, I would consider
that poor design...
Whoa there, you don't know what it's doing -- so saying poor design is probably not a good call.

 > And thus, two lines instead of three.
 But in fairness, the user_functions.php would
 establish a connection to the database and the
 function "set_user_name($user, 'tedd')" would
 simply use 'tedd' with respect to whatever
 "$user" is.
hmm that means you use only one user's info in the script. that's very
limiting.
Again, you don't know what's being called.

No reason to be insulting. What I am calling could be a pointer or an id to a record -- BOTH -- of which are no more limited than calling a class. What do you think languages are doing when they call segments of memory for data or function -- you think they pass ton's of variables or just a pointer? So, there's nothing limited here about what I'm doing. Think about it.


hey, no insult intended here... sorry if seemed so.
but, my point was exactly what you stated above. you say 'you don't know
what's being called' - that's the main problem I found with non-oop code
organization. with clearly defined classes every developer knows what he
calls without further explanation.

sure you can duplicate with procedural code anything my tons of classes
do... but above a certain project size it can easily become a
maintenance nightmare and an integration nightmare if there are more
than one developers. classes enforce some strict rules to everyone in
the team, so teamwork is much more efficient and the resulting codebase
is cleaner. I know from experience, as this project with the 400K lines
is a rewrite of the previous procedural version, which was developed and
maintained by a dozen of developers over the years, and it became such a
mess that none of us wants to touch it anymore...
Again -- the difference here is organizational style. Everything you can do in your classes I can do in my functions. Plus, you can have just the same amount of screw-ups as I can when you introduce more than one programmer and his style into the mix.

I don't like the tone here -- it appears that because I'm not agreeing with you that my code is limited or of poor design -- because let me assure you it's not!

So, let's just drop this -- you have your way and I have mine.

again, sorry for the tone if it was wrong - might be because I'm not a
native english speaker, or maybe because this is one of the craziest
fridays ever, I don't know. for sure, I didn't mean it.

and yes, let's drop this, I see I can't convince you.
anyway, I'm not an oop zealot, I just find it so useful and I tried to
explain my view of it - with absolutely no offense intended - so, happy
coding for you with your style and me with mine :)

greets,
Zoltán Németh

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com



Aww man, I was getting curious to see how nested this conversation would get. Think of the children! :)

PS. Happy Friday!!!

PPS. I'm hopped up on caffeine so ignore any stupid remarks.

--
Ray Hauge
www.primateapplications.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux