Larry Ullman

Translating Geek Into English

"PHP 5 Advanced: Visual QuickPro Guide (3rd Edition" Table of Contents

\[intlink id="1584" type="page"\]\[/intlink\]

”. This new edition is tentatively titled “Advanced PHP and Object-Oriented Programming: Visual QuickPro Guide”, which better reflects the book’s focus. The book is written for intermediate PHP and Web developers, and covers a range of topics to further extend what you know into more real-world, complex situations.

Great JavaScript Resources by Addy Osmani

In the beginning of March, I blogged about an excellent resource titled " Essential JavaScript Design Patterns", written by Addy Osmani. Mr. Osami is a JavaScript developer for AOL, a member of the jQuery core team, among other roles, and is an excellent writer. “Essential JavaScript Design Patterns” is a book-length document, available for free online, that does a great job of explaining not just design patterns in JavaScript, but also the concept of design patterns in general.

If you liked that resource, Mr. Osmani has several others you may appreciate, beginning with Patterns for Large-Scale JavaScript Application Architecture. The topic itself may be too specific for many developers, and I do disagree with his definition of what a large-scale JavaScript application is (Osami’s definition is non-quantifiable, and therefore a vague non-defintion), but the writing and suggestions are strong and concrete. The article begins with discussions of design theory, and then goes into the implementations of specific patterns that would be used in the underlying architecture. Each section also includes links to other good resources. There’s a corresponding presentation you can read, if you’d prefer just the bullet points.

Two More JavaScript Articles Posted Online!

Peachpit Press has published the second and third articles I wrote in support of my “ Modern JavaScript: Develop and Design” book. The second is " The 10 Best JavaScript Development and Design Habits". In it, I spell out ten specific recommendations. Many of them apply to using any programming language, while a couple are specific to JavaScript.

The third, and final, article is " 5 Ways to Improve Your Ajax Performance". Ajax is critical to today’s Web applications, so knowing how to use Ajax requests more optimally is valuable knowledge.

Although both articles are written to support my “Modern JavaScript: Develop and Design” book, neither require that you have the book. And, of course, they’re free, so check them out when you get the chance. Thanks!

Testing for Strict Mode in JavaScript Using this

The this variable is an important concept in JavaScript and in many Object-Oriented languages. (Technically this is a keyword, but that’s a minor point in understanding it.) The simplest way to think of this is that it references the object whose method is currently being called. (The harder, but more accurate, way of thinking of this is as a representation of the execution context, but I find that definition makes a person blink a lot while simultaneously scratching his or her head.) The brilliant Peter-Paul Koch describes this as the “owner” of the current method, which also works.

To put this into a context (double pun), take the following JavaScript code, which defines a custom object, representing a rectangle:

\[js\]\[/js\]

That code defines an object with two attributes and one method. The method, called using the code r.isSquare(), returns a Boolean value indicating if the rectangle is also a square or not. Since the isSquare() method is defined as part of the r object, within that method, this refers to r.