adequately good

decent programming advice

written by ben cherry




all posts from the year 2009

Consul.js, Simple Logging Abstraction

I've been reading Coders At Work by Peter Seibel, and one question he asks in every interview is "How do you debug - print statements, debugger like gdb, or something else?". For me, print statements are my first tool for any situation. That's why Firebug is so...

Javascript Pseudo-threading

This post has been migrated from my old, defunct blog at bcherry.net. The links may not work, and the formatting may be wonky.

I’ve been playing around with asynchronous Javascript for repeated large-set actions, in the hopes of generating some useful techniques for real applications. I’ve narrowed down a...

jQuery Micro-templates

John Resig wrote a neat micro-templating Javascript function a while back. I’ve been playing with this, and have discovered two things:

  1. These templates are totally nestable. Just make an element to be templated within a temp...

Managing CSS Through JavaScript

It’s often very difficult to keep track of what CSS goes where. Especially when you load up on Javascript controls and files in a large application, which render markup that depends on some CSS being there. One solution is to “inline” the CSS in the JavaScript, by adding style to each element as it’s created. This works, but it’s messy. Also, browsers are heavily optimized to apply CSS, faster than any Javascript solution could be. But when you’ve got a fancy script manager like LABjs, remembering to statically link all of the important CSS is a pain. Especially so if you’re not sure at page load whethe...

Building a Better Friend Selector

This post has been migrated from my old, defunct blog at bcherry.net. The links may not work, and the formatting may be wonky.

Working in social entertainment, one of the lynchpins of the entire business is the friend selector. Without it, there is virtually no way to grow your customer base. Having a simple, effective friend selector ...