1991-2016—25 years of Art & Logic

There is a Bug on this Code

There is a Bug on this Code

Software is a serious business. Fatal bugs have been around since at least the 1980s, and a decade-old report estimated the annual cost of bugs at $60 billion. Tech companies spend millions on political lobbying. Opponents argue over labor shortages and H-1B visas.

So how about we take some time out to give three cheers for a little levity?

[“hip”,”hip”]
hip hip array!
(more…)

Level Up Your Coding Skills With exercism.io

Level Up Your Coding Skills With exercism.io
A few months ago I stumbled across across an interesting open source project created by Katrina Owen called exercism.io that provides a collection of programming practice problems in over 30 languages. On the surface, it’s a great resource for learning to code or learning a new language. I’ve found however that as you dig deeper it has much more to offer on a number of levels.
logo
To get started you simply install the exercism command line client, login with GitHub, pick a language to work in, and fetch your first problem. The first problem in many languages is often just a simple “hello world” exercise just to get you started. When you fetch a problem you get a ReadMe file with a description of the challenge and a suite of unit tests. In TDD style you write code until the tests are passing and you’ve solved the problem. Afterwards, you submit your solution and other exercism users are able to review and comment on your code. You can carry on the conversation and submit additional revisions of your code as part of this informal peer code review.

(more…)

Configuring Backbone.Model Properties With Less Code

Configuring Backbone.Model Properties With Less Code

My previous post demonstrated the use of Object.defineProperty to programmatically add a list of properties to an ES6 class, such as a Backbone.Model subclass, reducing the amount of boilerplate code necessary. The example in that post added simple getters and setters, but it’s possible to go further for Backbone.Model properties, also configuring in a single data structure functionality like:

  • Options for properties, such as disabled setters
  • Default values for properties
  • Mappings for parsing date strings and model relationships

This technique uses a common base class from which all other model classes descend. The model subclasses (e.g. a user model) provide a list of property definitions, which centralize various aspects of those properties. The base class has configuration methods which iterate over the property definition objects.

In the particular examples below, the base configuration methods handle attribute to property name mapping, default values, and server data parsing, but this technique can be applied to other configurable property-related tasks, such as marking some properties blacklisted or viewable only by admins.
(more…)

Socks and Sandals (and software-development faux pas)

Socks and Sandals (and software-development faux pas)

I’ve worked with a lot of clients and potential clients over the past 10+ years. Sometimes, in conversation about a project, the client will roll out, oh-so-casually, one of about 10 pat statements that reveal a pernicious and erroneous belief about the process of software development. Now, most of my job involves educating clients so I take a deep breath and wade into the waters of a software-development ideation faux pas, of explaining why what the client has just said is analogous to pairing socks and sandals: Sure, it makes sense on one level, but it’s never a good idea. (Note: I’ve been chided by our development team that wool socks and Birkenstocks are certainly acceptable and that Keens and short anklets are also acceptable. I sigh. I choose to fight my battles one at a time. . .)

Moving on.

The objective here is to give the audience a bit of quick and dirty insight that, I hope, will help clients be . . . well, better clients. Better clients always, without exception, mean a more successful project — cheaper, faster and far, far fewer hair-tearing-out incidents. (more…)