Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
PHP and JavaScript are both C-family languages, and have similar structures like the way the if {} statements are formed, but that is really about all they have in common. JavaScript is object-oriented, but has no classes, and prototypal inheritance instead of classical inheritance. Everything in JavaScript is an object, while in PHP there is a clear separation between procedural and object-oriented syntax.
The scope of variables and functions in JavaScript work completely differently than in PHP. JavaScript has closures, PHP does not.
I recommend a separate study of these two languages. When I was starting out, I studied PHP, but not JavaScript. My reasoning was very clear: it is possible to make sites without any JavaScript whatsoever, but to form the habit of making strictly static pages without server dynamics seemed like a bad idea. If you study them together you are likely to become confused, especially if you have little scripting experience.
IMO, PHP is easier to grasp the basics of than JS, though an advanced study of both languages is an ongoing experience. Even the masters continue to study throughout their careers.
__________________
I build web things. I work for the startup Please login or register to view this content. Registration is FREE
.
Last edited by wayfarer07; 08-18-2008 at 08:25 AM..
|