Hi.
Next to me now is a good book that explains OOP programming in Java. I am wondering if I read that book then will I learn PHP and OOP in it easily?
And whether it is possible to learn PHP and Java simultaneously? Meaning that I start learning the fundamentals of PHP and learning OOP in Java and when I reach OOP in PHP I trasnfer what I have learnt from Java regarding OOP into PHP?
If you learn good foundations of programming, then the transition from one language to another it simple as it becomes a matter of syntax and classes. The problems occur when you become dependant on the shortcuts of languages, which are often sloppier and don’t cross between other languages as well.
Another thing to remember is that Java has strengths where PHP doesn’t and vice-versa. So doing something in both languages isn’t always a case of translating code - if it was then there would be no point in there being many different programming languages in the first place.
Also in Java and PHP there are different programming ideologies that you want to look out for. Because Java is often event-based and PHP generally isn’t, they have very different ideologies that you will need to pay attention to - for example, Java often seems over-complicated to PHP developers for its use of event-based design patterns (The popular Swing framework, for example, is riddled with listener patterns and somewhat extensive forced-polymorphism which often just overcomplicates simple tasks - but is ideal for complex tasks). PHP, to java developers, seems unstructured and horrible to make large applications with - whereas for small things its ideal.
Learning the foundations of programming in any language will be beneficial to PHP. However, learning the actual function names (API) of one language will not translate to another language.