What Is Larry Thinking? #61 => Taking JavaScript Further

October 1, 2012

In this edition…

About This Newsletter

In sorting through the volumes of thoughts and resources I have to share, I realized that there was plenty on beyond-the-basics of JavaScript. Still, not all of the items herein require knowledge of JavaScript, so you may want to peruse the whole newsletter. And if you don’t actually know JavaScript yet, then I can recommend a good book!

As always, questions, comments, and all feedback are much appreciated. And thanks for your interest in what I have to say and do!

On the Road => Speaking at Boston PHP

I’ve been invited to speak to the fantastic Boston PHP, user group (nearly 3,000 members!), who is currently using my “PHP for the Web: Visual QuickStart Guide” for Season 4 of their PHP Percolate! program. On Wednesday, December 12th, I’ll be presenting “How To Be A Web Developer”. This will be a new, 75-minute presentation on the tools and technologies needed to be a Web developer today. Along with the presentation, there will be socializing opportunities both before and after, and a Q&A session.

If you’d like to attend, you’ll need to join Boston PHP (you don’t have to live in Boston to do so), which is free. Then you can indicate your attendance (the presentation is also free).

Currently, I don’t know if the session will be recorded and distributed, but I will post my presentation slides afterwards regardless.

My thanks to Boston PHP for the hospitality!

On the Road => True North PHP Conference

Speaking of speaking, I am happy to say that my presentation on the Yii framework was officially selected for the inaugural True North PHP conference. This conference is taking place in Toronto, Canada, on November 2 and 3, 2012 (I don’t know yet which day I’ll be speaking). If you’d like to meet me and/or see my presentation, make sure you get your ticket to the conference. I figured I would also make myself available for lunch on those two days if anyone would like to chat with me more directly.

My thanks, too, for those that voted for my presentation!

On the Web => Bootstrap, from Twitter

Some time ago, Yogesh had mentioned Bootstrap to me, a front-end framework created by a couple of Twitter developers. Although not just for JavaScript—primarily Bootstrap is about HTML5 and CSS, the framework does come with the most common functionality often provided by JavaScript, including:

  • Transitions
  • Modal windows
  • Dropdown menus
  • Tabs
  • Tooltips
  • Alerts
  • Accordions
  • Carousels

As is often the case, Bootstrap was not on my radar for some time, and then all of a sudden, I’ve used it on three projects in the past month (including the revision of my own site). And for someone like me, with practically no design skills and only a perfunctory understanding of CSS, being able to quickly create stylish-enough Web components is a real boon.

If you’re curious as to how Bootstrap came to be, check out this article at A List Apart, which Yogesh also recommended to me.

UPDATE: As this newsletter was “going to press”, it was announced that Bootstrap is being separated from Twitter and turned into its own open source project.

On the Web => The impress.js Presentation JavaScript Library

Some time back I stumbled upon impress.js, a truly amazing Web-based presentation tool. You have got to check out the demo page (in a modern browser), you will be blown away. After running through the presentation (which will only take a minute), check out the HTML source code to be further amazed. I’m normally not this hyperbolic, but I was quite stunned by what was possible with impress.js. Besides being a useful tool for HTML-based presentations, this library is capable of changing how one thinks of presentations as a concept. Instead of presenting information in a linear, traditional format, with impress.js, you can do things like go from a bigger picture to a smaller picture, to be able to zoom in on content, as it were. If you pay attention to the URLs, you’ll note that impress.js also creates bookmark-able pages, which is an added bonus.

If you check out the examples and demos page on GitHub, you’ll find links to other presentations created with impress.js. A couple of presentations are quite useful in that they demonstrate, in my opinion, an overuse of impress.js. Those particular presentations use the rotation feature to such as extent that it makes one dizzy, which is normally not a good quality in a presentation (although one presentation is talking about 3D transformations, so there’s some justification there). One does worry that if impress.js catches on too much, we’ll all be sick of rotating transitions in no time.

On the Web => Great JavaScript Resources by Addy Osmani

In the beginning of March, I blogged about an excellent resource titled “Learning JavaScript Design Patterns”, written by Addy Osmani. Mr. Osami is a former JavaScript developer for AOL (now he works for Google, I believe), a member of the jQuery core team, among other roles, and is an excellent writer. “Learning 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, 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 view, if you’d prefer just the bullet points.

Towards that end, you may want to check out Mr. Osmani’s other presentations, which primarily focus on performance issues, scaling JavaScript, and jQuery.

On the Web => JavaScript Style Guides and Beautifiers

Also from Mr. Osmani is an excellent introduction to JavaScript Style Guides and Beautifiers. In the article Osmani starts by explaining what style guides are, why they’re important, and what the most common options are. Then the article explains how one might apply style rules to some sample code. The article concludes with a discussion of beautifiers.

All in all, well worth reading if you do any JavaScript programming.

On the Web => JavaScript Best Practices

I recently came across two good resources that discuss some best practices when it comes to JavaScript. The first is an article at Developer Drive, titled Top 10 “Must Follow” JavaScript Best Practices, written by Salman Siddiqui. It’s a pretty good list, with a range of beginner to advanced topics. I would disagree with one, however: “Better to avoid DOM.” While DOM manipulation is expensive, it’s often required, so I think it’s better to acknowledge that this is a necessary evil we’re stuck with and hope that browsers continue to make improvements in this area. I liken it to the common economic theory that getting a loan to buy a car makes poor monetary sense (because it’s a loan on something that depreciates). The fact is most people need a car to work and make money, so a car loan is often necessary. But I digresss…

The second resource is a presentation titled JavaScript “Best Practices”, by Christian Heilmann. Heilmann presents about 20 specific suggestions and then explains them all in detail. The presentation itself lacks pretty much any style whatsoever, but content is more important, no? There’s lots of code in the presentation precisely demonstrating both good and bad behaviors, along with explanations as to why something is problematic.

On the Web => JavaScript Resources from Peter Cooper

Peter Cooper is a jack of many trades, perhaps best known for his various weekly newsletters. If you’re not already subscribed, I’d highly recommend his JavaScript Weekly and his HTML5 Weekly. If you’re using Twitter, you can follow JavaScript Daily, which tweets out JavaScript-related news and links.

On the Blog => Testing for Strict Mode in JavaScript Using this

Back in March, I posted an article on my blog titled “Testing for Strict Mode in JavaScript Using this”. In it, I start off by explaining just what this is in JavaScript. Then I demonstrate a somewhat obscure trick for how this can be used in JavaScript to confirm whether or not the browser is current running in strict mode.

Book Giveaway => “PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide”

You must be subscribed to the newsletter in order to qualify for a book giveaway.

Larry Ullman’s Book News => “PHP Advanced and Object-Oriented Programming” and “The Yii Book”

Just a quick bit of news…The “PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide” book (the third edition of my PHP Advanced text) should be available at US bookstores now. You can also buy the Kindle version at Amazon or other electronic formats at Peachpit.com.

I’m now writing away on the Yii book. The table of contents have been posted on my blog, if you’re curious. My hope is to begin selling the book next month. I should have at least the first part done at that point. A new Web site is being created to sell the book; once it’s up, I’ll make the URL known. Thanks to everyone interested in this book!