#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171

    Should one learn Java first, then PHP?


    Generally speaking;

    To master writting well written OOP with Php, isn't it a better idea to learn Java first then try it with Php?
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    IMO Java is better for learning OOP than PHP. Meaning that you find something that teaches OOP in Java, then apply what you've learned to PHP.

    Biggest downside you'll find is that PHP does not support some features things as well as other languages (or even at all). Java and C# both have more mature implementations than PHP.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    it certainly makes sense to look into other languages and see how they do it. But learning Java first in order to somehow write better OOP code in PHP sounds way over the top and a waste of time. You don't need to be a Jumbo Jet pilot before you can fly a kite in your garden. Some OOP concepts may be easier to understand in Java than in PHP, but Java also comes with a lot of baggage that simply won't be useful for a PHP programmer. And it's not like Java taught you some "special OOP knowledge" you couldn't learn anywhere else.

    Also, why Java? Sure, it's kind of the poster child of OOP (for whatever reason), but it's complex and verbose. There are much more lightweight languages out there, which don't bury the ideas of OOP under tons of boilerplate code.

    Check Ruby. It's pretty simple, clean and more object-oriented in many aspects (for example, it has no "primitive data types", every value is an object). Or how about Python? It's also very lightweight, and many consider its programs to be "executable pseudo-code". In any case, both are much easier to grasp and use. And since they're dynamically typed scripting languages themselves, there's not this huge gap to PHP.

    OOP is more than Java -- just like web programming is more than PHP + MySQL.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  6. #4
  7. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    506
    Rep Power
    128
    If you're thinking purely in terms of working in a strict OO environment before going to PHP's loose environment, then what Jacques1 said.

    If you have ambitions to improve your resume, then learning Java wins a few points. And I hate to say that. I really do. I don't like Java and resisted learning it (well, the horrible environment anyway) when my previous employer tried to move exclusively to it and it kind of backed me into a corner. Companies seem to like it since it can be used to do anything so they only need to hire for a focused skill set, so it'd be easier to find job opportunities.
  8. #5
  9. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    23
    Rep Power
    0
    Yes it is better idea to learn JAVA first and then PHP.
    Because oop concept are covered in java.
    It becomes easy for you to learn PHP after JAVA.
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Location
    Burb of Detroit, Michigan
    Posts
    86
    Rep Power
    76
    I'll give my .02 cents. I come from Flash Actionscript 3 and did a few programs in OOP. I have to admit that I didn't fully understand OOP when I wrote a few applications for a class I was taking. Then the last 6 months I have been slowly learning the PHP language and I am finally getting into OOP that last couple of months. I found a good book on PHP and OOP which has progress my skills where I finally starting to understand OOP, though I still have a ways to go before I can comfortably say that I have master it. Though I would hazard a guess that one is always learning something new in OOP.

    In short, pick a language, find a good (current) book on what ever language you are learning, and visit forum(s) to resolve tough issues that you are having problems with. I plan to grab a book or two on design patterns on OOP (Which the book suggests to do) to further my grasp on OOP even further. In my opinion you don't have to learn another language in order to learn OOP, granted that language might be more "robust" in OOP. However, you're still go to be limited or don't have that capability when you do go to the other language. Besides, you don't know what your missing if you start of in the language that you truly want to learn in the first place.
  12. #7
  13. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,650
    Rep Power
    171
    Originally Posted by Strider64
    I found a good book on PHP and OOP which has progress my skills where I finally starting to understand OOP
    What is it called
  14. #8
  15. No Profile Picture
    Dazed&Confused
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2002
    Location
    Tempe, AZ
    Posts
    506
    Rep Power
    128
    Originally Posted by zxcvbnm
    What is it called
    A book about OO concepts: Good.
    A book for PHP: Eh.

    Maybe he found a diamond in the rough, but I gave up getting books for languages long ago. They change too fast. Better to just use online resources for information there.

    A book about OO concepts, however, will remain relevant for some time.

IMN logo majestic logo threadwatch logo seochat tools logo