Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Know PHP? Learn JavaScript

DZone's Guide to

Know PHP? Learn JavaScript

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

Years ago I learned PHP because someone else's web form was broken, and I needed to fix it. Apparently this kind of perforce-introduction to PHP is pretty common (and, some say, tends to form bad habits early), so I don't feel too bad about never having learned the language formally.

The result, though, is that my web programming brain leans pretty heavily server-side.

If you're like me, then Stoyan Stefanov's introduction to JavaScript for PHP developers might prove extremely useful.

Stoyan seems like a perfect person to learn from -- he's written six books on JavaScript and PHP -- and his blogpost and presentation are both very clear. For example, here's a PHP associative array:

$fido = array(
  'name' => "Fido",
  'barks' => true
);

and here's the JavaScript object literal he compares it to:

var fido = {};
fido.name = "Fido";
fido.barks = true;

The slideshare presentation, which compares many syntax feature side-by-side, is embedded below. Click through it, or check out Stoyan's article for a more compressed version with lots of helpful comments.

 

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}