|
Posted by Darko on 11/07/07 19:47
On Nov 7, 4:36 pm, Rob <ratkin...@tbs-ltd.co.uk> wrote:
> On Nov 7, 2:11 pm, firewood...@yahoo.com wrote:
>
>
>
> > I need some help in furthering my education in OOP. I have developed
> > a set of PHP scripts that I use in a fairly sophisticated database
> > driven website, but I am not proud of the rather amateurish
> > programming that I used to create the functionality. Although I use
> > classes and objects to organize my data and their related functions,
> > it seems to be only marginally better than plain procedural
> > programming. For example, I do not use inheritance, much less
> > polymorphism.
>
> > The next step, it seems to me, is to become much more skilled in
> > analyzing a program from an OOP point of view and learning the
> > techniques for organizing the structure of the scripts and how to
> > implement them in a website. In other words, I want to move from
> > amateur to pro in terms of both career and technique.
>
> > Can someone point me in the direction of the right schools(online),
> > books, websites, example code, or other assets that I can use to
> > learn?
>
> > Also, is PHP the best language to use to learn and implement the full
> > power of OOP? If not, any suggestions?
>
> Although I hate to say it, C#.Net is probably the best way to learn
> OOP at the moment, as it pretty much forces you to write code in
> the .Net way.
If you hate to say it, then don't say it :) I know it is an expected
behaviour here
at comp.lang.php to go around saying how Microsoft's products are bad
and how all the
rest is great, but I'm not trying to do that since I try not to be
emotionally related to
something I consider only my job.
But I had some experience with C#.NET in web programming, and I must
say it only distanced me
from real programming. Like Wasmus already mentioned intranets, that
was exactly what I was working
with, and maybe because I'm "I have to know how it works in details"
fan, I hated it. The thing I was
working with most of the time was Visual Studio's design environment,
clicking on objects and
setting its properties, creating SQL connections as they call it,
relating them with data views etc.
since they try to make non-programmers programmers. I really don't see
a problem typing a few lines of
code for sake of knowing where my bug can happen to be, instead of
drawing in Visual Studio expecting it
to do most of the work for me. OK, then you enter the source and meet
those famous "phases" (I don't remember
exactly how they called them) through which the page gets until
finally parsed on the screen, where you
have to be REALLY aware what you may and what you must not put in each
"phase", which is all mentioned
in very detailed MSDN's "documentation" and is the #1 source of
bugs .NET-wise.
So, if the topic starter needs to be _forced_ to make all in classes,
then he/she can use Java. I don't
really see the reason for that since, like Wasmus said already, it is
a little bit silly to make
contact forms or other small pages with objects. There is place and
time for everything, so that's exactly
PHP (and C++, for example) philosophy - use OOP if you need it, don't
use it if you don't need it. It is
only an important thing to be able to notice that you need it, which
is another story.
I think PHP is quite enough to learn OOP, though e.g. I learned it
from C++, then Java, then PHP.
As for schools, etc. I don't know how old topic starter is, but if
they haven't outgrown college, this
is probably the best place for it. As for out of college schools,
online, tutorials etc. then it's probably
reading other people codes + experience + everything else. I don't
remember I've seen lately any good documents
online that teach *good* and involve practicing various OOP techniques
etc, except for various Design patterns
tutorials which you must make sure you've read.
http://en.wikipedia.org/wiki/Design_Patterns
http://www.csis.pace.edu/~bergin/patterns/ppoop.html
http://www.phpkitchen.com/index.php?/archives/173-OOP-Explanation-of-the-Factory-Design-Pattern.html
etc.
[Back to original message]
|