Page 2 of 2
Posted: Wed May 30, 2007 9:12 am
by superdezign
arborint wrote:superdezign wrote:Is there something that I'm missing?
Uhhhhhh .... the benefits of inheritance?

Well, I haven't seen a time where I'd have use for inheritance, yet.
Hockey wrote:I'm trying to understand what your doing here, doesn't sound OOP. Instead of inheritence you add conditional logic in your object?
Yes, that's exactly what I'm saying, but I've never done it yet. I've done it JavaScript once, but that's because I barely know how JavaScript makes classes (prototype this and that), so I'm clueless as to the syntax.
Plus, it only affected one thing.
Code: Select all
this.__object.style.display = (this.__type == 'inline') ? 'inline' : 'block';
Posted: Wed May 30, 2007 1:01 pm
by Ollie Saunders
Well, I haven't seen a time where I'd have use for inheritance, yet.
Perhaps you have not had to write a particularly large project but you haven't understood some of the most important principles of OO.
Your code will be depending on concretes instead of abstractions and you won't be able to achieve any polymorphism. Polymorphism replaces a lot of logic which means less work and fewer bugs. And depending on concretes is bad because your classes will be tightly coupled and you'll be performing shotgun surgery (making changes to several classes in order to achieve something) all over the place to get them to work. Nor will you be able to implement "code closed to modification but open to extension" which means a doddle of a task to a proper OO programmer will be a real head ache for you.
In short: your code won't scale.
Posted: Wed May 30, 2007 1:44 pm
by superdezign
Wow... I just got to thinking about it and reading through some of my longer, function-heavy classes, and have realized how right you are. Luckily, I've started from scratch just recently, so I can do something about it from the get-go.
I never really noticed it till it took my longer than a few second to scroll down a file. There are so many functions specific to different things, and I've got them all in one base class. Silly stubborn me. :-p
Posted: Wed May 30, 2007 2:56 pm
by Christopher
superdezign wrote:Silly stubborn me. :-p
Nope ... You just heard a click!
Honestly, all of us have much to learn -- which is why we are here. I read something from a smart guy like
ole and it clicks for me. I may have heard it before, but the combination of how he said it and things I have been working on help it finally click. I give his idea a go and write about that worked for me ... and hopefully that helps someone else.
You want to learn PHP? Read the posts in these forums thoughtfully and ask questions. Plus use the web -- go to planet-php.net and see what PHP bloggers are are talking about.
Posted: Wed May 30, 2007 2:59 pm
by superdezign
I just answer any question that I think I can, and wait to either be proven right or wrong.
DevNetwork humbled me after my first week.
Posted: Wed May 30, 2007 4:32 pm
by Ollie Saunders
For me its rewarding to learn something but it pales into insignificance to the warmth I feel when people really advance as I result of something I say.
I think I'm destined to be a teacher some day.
Read the posts in these forums thoughtfully and ask questions. Plus use the web -- go to planet-php.net and see what PHP bloggers are are talking about.
Forums are great for when you get in a silly mindset and you need someone to pull you out or you just don't get something that is supposed to be relatively simple; I certainly get plenty of these when I try and learn something new. Web tutorials are dangerous because they aren't always accurate, but as long as you have the ability to judge the reliability of a website they are definitely valuable and there's nothing faster. But for me there's nothing better than a critically acclaimed book. This must be the forth time I've posted
this title here but it's really great.
Posted: Wed May 30, 2007 4:51 pm
by superdezign
ole wrote:For me its rewarding to learn something but it pales into insignificance to the warmth I feel when people really advance as I result of something I say.
I think I'm destined to be a teacher some day.
I'd love to be a teacher! And to teach programming... That'd be a job I'd love.
ole wrote:Read the posts in these forums thoughtfully and ask questions. Plus use the web -- go to planet-php.net and see what PHP bloggers are are talking about.
Forums are great for when you get in a silly mindset and you need someone to pull you out or you just don't get something that is supposed to be relatively simple; I certainly get plenty of these when I try and learn something new. Web tutorials are dangerous because they aren't always accurate, but as long as you have the ability to judge the reliability of a website they are definitely valuable and there's nothing faster. But for me there's nothing better than a critically acclaimed book. This must be the forth time I've posted
this title here but it's really great.
I feel as though the the forum is, possibly, the best resource. There's a natural system of checks and balances here and everyone here knows something worth discussing.
Posted: Wed May 30, 2007 4:59 pm
by Ollie Saunders
So. If I ran some classes would anyone come?

:D
Posted: Wed May 30, 2007 5:03 pm
by superdezign
ole wrote:So. If I ran some classes would anyone come?

:D
Certainly me!
You're one of the better programmers here.
Posted: Wed May 30, 2007 5:37 pm
by s.dot
ole wrote:So. If I ran some classes would anyone come?

:D
ay ay, count me in captain. I could use some good ol' ole knowledge.

Posted: Wed May 30, 2007 5:40 pm
by Weirdan
ole wrote:So. If I ran some classes would anyone come?

:D
How much would you pay?

Posted: Wed May 30, 2007 5:45 pm
by Ollie Saunders
Weirdan wrote:How much would you pay?

hehehe lol
Posted: Thu May 31, 2007 2:33 am
by Kieran Huggins
Can I extend your classes? (sorry)
Posted: Thu May 31, 2007 2:38 am
by John Cartwright
Go to bed Kieran.. go to bed...

Posted: Thu May 31, 2007 2:59 am
by Kieran Huggins