June 12th, 2013, 04:17 AM
Should one learn Java first, then PHP?
To master writting well written OOP with Php, isn't it a better idea to learn Java first then try it with Php?
June 12th, 2013, 04:45 AM
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.
June 12th, 2013, 06:57 AM
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.
June 12th, 2013, 11:03 AM
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.
June 26th, 2013, 08:59 AM
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.
June 26th, 2013, 09:41 AM
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.
June 27th, 2013, 05:47 PM
What is it called
Originally Posted by Strider64
June 27th, 2013, 06:20 PM
A book about OO concepts: Good.
Originally Posted by zxcvbnm
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.