lucisferre

“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. —Sir Charles Antony Richard Hoare”

Three Useful jQuery Event Binding Tips

Permalink

I want to share a few tips based on the way I’ve been writing Javascript (well Coffeescript) for front-end development lately. A lot of it is co-opted from the Bootstrap libraries but are completely universal and can be applied almost anywhere.

I’ve been using these techniques to design small independent component libraries to encapsulate the interactivity of UI elements. These components are then bound to elements based on conventions. This has pretty much eliminated any need to use frameworks like Backbone to keep the javascript clean and maintainable. In fact, I find I prefer it this way, at least for Rails development. In other scenarios, as always, YMMV, but either way I think these tips will be useful regardless of your choice of javascript framework (if any).

The Only Thing Killing Your Corporate Culture Is Your Corporate Culture

Permalink

It’s pretty clear people agree that corporate culture is a big problem. There is blog post after blog post talking about what to do, or not to do, to create a great culture. Sadly, most of it though boils down to: Company X has a great corporate culture so just go cargo cult whatever magic sauce they’ve got going for them. Today’s suggestion is fix your e-mails dammit, if we could only stop sending such motivation destroying e-mails. Other days it’s those soul sucking meetings, won’t someone think of the agendas!?

Honestly, I think there is a critical ‘correlation equals causation’ fallacy going around here, which is that corporate culture can ever be a symptom rather than the cause. The fact is, culture is what is at the root of everything and everything that represents a good corporate culture stems from it rather than contributing to it.

Erlang Factory Lite Vancouver

Permalink

Last Saturday I spent my precious weekend enjoying the Erlang Factory Lite Vancouver edition, a one-day Erlang extravaganza.

Now, since I don’t know all that much about Erlang—I’ve only managed to complete the 7 languages in 7 weeks section on it, which culminates in creating Tic-Tac-Toe—I’ve kept a running blog of my notes throughout the talks, for later reference and afterwards distilled it down into the summaries you see below. So essentially I’m live blogging with a two-day time delay (a little trick I learned from NBC).

So lets get started…

jQuery Plugin for Really Tracking Text Input Changes

Permalink

It may come as a bit of surprise to some, but the change event on HTML text inputs does not actually get triggered when the text changes. It is only triggers after focus is lost (on the ‘blur’ event). This isn’t always a problem but it comes up often enough for me to get fed up and create a jQuery plugin for this.

This is the first real jQuery plugin I’ve really had the need to write. I’ve generally always found what I’ve needed by googling for it, or at least found something close enough to be easily modified for my purpose.

If anyone has suggestions for ways to improve this, or sees any pitfalls I’ve missed let me know, or, you know, just edit the Gist. On the other hand, if anyone wants to suggest it should be written in javascript you can go take a long walk of a short pier.