|
Posted by Jerry Stuckle on 05/17/07 01:01
Dikkie Dik wrote:
>> I think learning OOP in PHP causes bad habits. There are too many
>> different ways to do it. If you learn from a language like Java, you
>> will certainly get it down very well. PHP5 has many of the features of
>> Java OOP (not all of them, though).
>
>
> On the contrary. Java also has quite a few unwanted characteristics as
> an OO language. I agree that Eiffel would be a better place to start,
> but it remains abstract, as it is hardly used. Also, PHP programmers
> often have to learn javascript as well, so you gain an understanding of
> both class-based and template-based object orientation.
>
> I think the "bad habits" are a good thing to start from. As a resource
> on how to learn OO programming, I would also recommend "Refactoring" by
> Martin Fowler. The examples alone in that book can teach you as much as
> a good theory book.
>
> I think PHP offers you the opportunity of gently discovering the
> advantages of objects. In fact, a lot of people only need to realize the
> power of a component like PHPMailer or FPDF to give abstract words like
> "code reuse" a firm body.
>
> Best regards
I don't know what "unwanted characteristics" java has as an OO language.
It is a pure OO implementation. And I agree with Mike - I think Java
is a much better language to learn OO programming.
And I've found the "bad habits", once you get into them, are very hard
to break. I don't know how many times I've had C++ programmers who got
off to the wrong start with OO programming and the result was a
horrendous mess of OO and non-OO code.
Smalltalk is also a great language for learning OO, but it's not used in
web programming.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|