Thoughts on software craftsmanship.

jQuery Coding Standards and Best Practices

Abhinay Rathore has compiled a treasure trove of best practices for working with jQuery (and DOM manipulation in general), and best of all it’s well-annotated with links to explanations and performance comparisons to back up the recommendations. I learned more than a few tricks to improve performance, like detaching DOM elements before engaging in heavy manipulation, using string concatenation instead of appending elements, and passing an object literal to $el.attr({attr: value}) instead of chaining multiple attr() calls.

Continue reading...

Web Page Rendering Performance

Paul Lewis is a Developer Advocate on the Google Chrome team, and he’s been on fire lately with a series of excellent articles on the nuances of web page performance from the perspective of the browser. If you do front-end development (like I do), and you don’t know what frames, paints, and layers are (like I didn’t), then Paul’s articles are an excellent introduction to why your site isn’t silky-smooth when scrolling or animating.

Continue reading...

Impossible Programs

Here is a fascinating talk—from Tom Stuart at last year’s Scottish Ruby Conference—on the subject of programs that are impossible to write in Ruby. Computers are logic machines, and Stuart takes us on a tour of many of the underlying problems with logic and how they manifest themselves in computer science, touching on things like undecideability, the halting problem, and Rice’s theorem.

Continue reading...

Hammock-Driven Development

Part of what drives us as programmers is a desire to solve problems. We get requirements, and our brains immediately begin formulating solutions, which we analyze and from which we pluck the best one to implement. At least, that’s how it’s supposed to work. Then, there are hard problems: problems which are difficult to understand, problems which don’t immediately suggest their solutions, and problems with no best solution but only tradeoffs.

Continue reading...

The Mature Optimization Handbook

From Facebook’s Carlos Bueno, The Mature Optimization Handbook is a short but valuable guide to the strategy behind performance optimization. Instead of tips for improving specfic technologies, the author addresses things like whether you should optimize at all, how to determine what to optimize, and how to validate whether your optimization had the desired effect.

Continue reading...