blog.hasmanythrough.com Archives - 24 April 2013, Wednesday

In Ruby, #length and #size are synonyms and both do the same thing: they tell you how many elements are in an array or hash. Technically #length is the method and #size is an alias to it. In ActiveRecord, there are several ways to find out how many records are in an association, and t...

A project I'm working on now is up to 57 model classes and is still growing. That's a lot of classes - welcome to domain modeling. In my opinion, the number of classes is a fair tradeoff that keeps each class simple enough to understand. In some ways it moves complexity out of the mod...

Related:

The first thing this approach helps with is being able to make frequent commits without breaking the build or disrupting the work of teammates. Working with a centralized SCM system like Subversion can force you to choose between checkpointing your work and keeping the state of the pr...

Dynamic finders work only with model attributes, not with associations. So if you have a belongs_to :user association on an article, you have to write Article.find_by_user_id(user.id) . I have an experimental patch that provides this functionality. I'm not entirely sure what to do wit...

Do you dream of someday speaking at a technical conference? Have you spoken at a conference but felt like your journey to the podium wasn't as smooth as it might have been? Well here are a couple tips to make things go smoothly and endear you to your conference organizers. I'm writing...

David, I agree it's heading there, but mostly the current rich client apps talk to custom web services. That is, you have to write code for both the client and the server. I expect there will be some standardization that lets the client code have all the custom logic. Think of a clien...

As coders, most of us are not only familiar with the term yak shaving , but spend many of our days doing nothing but. I often struggle to explain to non-technical folks what I actually spend my time doing when I'm working and what it feels like. This is the most accessible explanation...

Any advice on how to break the cycle? Reflecting on my own development experience, I think I need to be better at detecting when I need to stop and take a break, and when I need to motor on. Its not just fatigue - I do great work when fatigued, and also do crap work. Its a complex equ...

I was going to try and be clever and do a funny riff on this whole subject, but I just can't manage it. Here's the thing. Makefile was a dumb name for a file when Stuart Feldman wrote the make utility in 1977, but you have to forgive him because file systems were quite limited back th...