June 13, 2011 -
0 Comments -
tools
One thing I’ve found that most engineers dislike is the overuse of tools. I’m not talking about build tools or other command line tools, which automate repetitive tasks and make our lives easier. I’m talking about the tools that management wants everyone to use, whether it be for bug tracking, feature reviews, project management, or any other work that is peripheral to the actual task of writing software.
These tools aren’t inherently bad. They can be of great assistance to the process of deploying quality, production-ready code. But I’ve encountered the situation more than a few times where these tools have done more to get in the way than they have to actually help. Usually it’s either due to not picking a tool and sticking with it, or to using tools where they aren’t necessary.
Exhibit A: Too many tools
Here’s one scenario from real life. One company I worked at used five different tools for tracking progress. Five. Two is one too many, and they had five. Trac, Pivotal Tracker, Basecamp, and a couple others whose names I don’t even remember, all played into some sort of chaotic dance to which nobody in the company knew the steps. Every project had its own…
Read more…
February 13, 2011 -
2 Comments -
elite command
analytics
ruby
rails
This is the first in a series of articles I intend to publish about the technology, philosophy, and process behind my latest Rails project, Elite Command. Elite Command is a turn-based, multiplayer strategy game, and a lot of interesting approaches were taken in developing for its unique requirements.
Before I get too into the grittier aspects of the game, I’m going to cover something which applies to any web application which strives for commercial success: analytics.
Having designed and maintained various analytics platforms over the last three years, I’ve learned a thing or two about best practices and capable architectures for supporting the requirements of a robust analytics infrastructure. I’ve also learned a lot about the types of metrics which are most useful in a business sense. With this knowledge, adding analytics to Elite Command was a matter of choosing the 20% effort which would yield 80% of the useful results. That’s why the first analytics tool I baked in was funnel tracking.
Note that my code is using MongoDB with Mongoid for the ORM, but that this is all just as applicable to whatever data store you may be using…
Read more…
January 27, 2011 -
0 Comments -
programming
In the last month, I’ve had ample time for the first time in a long time to really dive into a solo programming project. It was something I had actually been working on for longer than that, but not until this last month have I had the rare chance to work completely uninterrupted on my own. The result is a product launch—that’s right, this thing is shipping, next week! When that happens, I will write a more detailed post about some of the approaches, fairly unique to the Rails world, which I took to a few different problems.
But first, I wanted to write a post reflecting on the merits of working alone as a programmer. There are many articles which talk about the different challenges and advantages of working in teams, but rarely on programming solo. This makes sense, to an extent, as most of us have Actual Paying Jobs™ and work with teams more than we work alone, and there is also all the ongoing buzz about the benefits of pair programming over the last several years. At the same time, though, it’s surprising, since most of the best programmers I’ve met on various teams got their start doing it on their own, as a hobby, as an amateur, a lover of the craft, and only joined com…
Read more…
April 02, 2010 -
0 Comments -
ruby
facebook
I recently encountered a need for a minimal wrapper for Facebook’s API, so I wrote SimpleFacebook. Clocking in at just 56 lines, it’s perfect for interfacing with Facebook via Ruby, and nothing more. This is not intended as a replacement for Facebooker or RFacebook. It doesn’t provide any explicit Rails integration, such as controller filters for gating users. It only does the dirty work of putting together a valid API request and returning the results, deserialized from JSON. Example usage:
What is it useful for? My use case was an asynchronous worker which needed to grab some data from Facebook to be stored in a database somewhere. A Rails process was not necessary to do this, so loading up Facebooker or RFacebook seemed like overkill.
Someone else might find it useful, so I’ve released it under the MIT license. Everything is up on GitHub, which you can download and install as a gem (using rake install). The code is fairly simple, and fleshed out with specs.
Read more…
November 06, 2009 -
0 Comments -
ruby
tools
bluepill
god
At Serious Business, we’ve been using God to monitor long-running background tasks and other daemonized processes. While God provides a nice DSL for configuration, it has issues with memory leaks which forced us to keep a close eye on it (meta-monitoring?) and reboot it periodically via cron.
To remedy the problem, a few of the guys got together over a weekend and wrote Bluepill, a replacement monitoring tool with a DSL inspired by God, but written for low memory consumption. Check out Arya’s blog for a detailed explanation and breakdown of Bluepill’s features. See the graph comparing Bluepill and God memory consumption over time. You’re sold.
September 21, 2009 -
0 Comments -
tdd
Lately in test-driven development, I’ve noticed that I tend to write tests against invalid input before I get to tests against valid input. This is a subtle technique which I think merits some discussion.
One of the big wins with TDD is the way that it forces you to think about the problem in terms of the API; this pushes the engineer to design to an interface, not an implementation, which is one of the major takeaways from the original Gang of Four book on design patterns. And I think the higher-level concern that designing to an interface facilitates is the process of knowing the problem domain, which leads organically into the process of dividing up responsibilities between discrete classes and modules.
In many ways, a problem domain can be defined not only by what it’s supposed to do, but also by its constraints, the cases in which it should fail. Thinking about these cases upfront, testing against invalid or nonsensical inputs, leads to software which is more resilient to misuse and unexpected scenarios.
I find that defining these c…
Read more…
July 24, 2009 -
8 Comments -
ruby
rails
spam
tools
akismet
When I decided that I would roll code.isdangero.us as a custom-made blog in Rails, I thought of it as a fun, easy project. After all, blogs are simple, and the simplicity allows for plenty of room for attention to detail in making the code as tight as possible, similar to the way a haiku allows a poet to express his skill in language through the power of the simply-stated.
Of course, every project looks easy from a distance, because unforeseen problems are just that: unforeseen. It had been a while since I’d blogged, and therefore I had all but forgotten about the long war of blog software against the endless networks of compromised Windows machines turned into Viagra-pitching zombies, comparable in number to the mighty armies of ancient Persia.
Enter Akismet
Just as the 300 men under the command of King Leonidas of Sparta held back Persia’s onslaught by fighting in the shade, the forces of good in this war have gathered together their disparate forces into a collective known as Akismet.
Akismet is an API which tracks spam and ham submissions from participating blogs all over the world, building its knowledge of what spam looks like versus c…
Read more…
July 13, 2009 -
3 Comments -
development process
company culture
Josh Susser at has_many :through has a great post about Discipline and creativity in the software industry. I find his comments on a sustainable development pace particularly striking:
One of the things I like best about working at Pivotal is that we consistently work at a sustainable pace. I can’t believe how many startups advertise jobs where they say that they expect you to work “startup hours”. I won’t even consider working at a place like that ever again. It’s not just because I don’t like working that way myself, but because I think companies that expect and require that kind of pace from their developers are just going to screw themselves and burn out their developers. They’ll either get real about what they can sustain, fail, or figure out how to deal with a high attrition/turnover rate.
I have had the experience of working at a startup which always demanded “startup hours” between tight, overlapping deadlines and indecisive clients, coupled with an organizational failure to adequately respond to their ever-fluctuating requirements. For the kicker, the company…
Read more…
June 24, 2009 -
2 Comments -
ruby
rails
activerecord
sql
So let’s say you have a custom SQL query which, for one reason or another, doesn’t fit nicely into ActiveRecord’s finder options. Here is an example using a subquery:
This query does just what the method describes. If you call Order.average_revenue_per_month, you will get back the average total revenue from orders each month. Great, that was easy!
What about associations and named scopes?
Hold up. ActiveRecord provides a great framework for mapping database tables to objects which can do amazing things as long as you stick to the basics. One of those things is the ability to call class methods on associations and named scopes. For example, we can call User.find(1).orders.average_revenue_per_month, and it should do exactly what you expect it to within the scope of that particular User’s Orders. But that only works if you’re staying inside the bounds of ActiveRecord’s finder methods.
In this case, it would be impossible to fit our query into the standard finder methods and still have it work with associations and named scopes as expected. So what do we do, throw our hands up in dismay an…
Read more…
June 01, 2009 -
4 Comments -
arduino
ruby
tools
The Backstory: I spent the majority of my last Saturday at the Maker Faire, an event centered around showing off all the amazing things that people have made themselves. Everything you can think of got due coverage, from robotics to custom musical instruments to automated fabrication to clothes and food. It was a great event and I’d recommend anyone with the hacker spirit to check it out next year.
While I was there, one of the focal points of my interest was around all the amazing things being done with the Arduino, a small circuit board with a microcontroller, programmable through USB. I had read about it before, first I believe in connection with Archaeopteryx, the probabilistic step-sequencer from the venerable and widely-hated Giles Bowkett. My curiosity was already primed and ready by the time I discovered the Arduino starter kit, which included sensors, LEDs, jumper wires, a book, and other assorted things I needed to begin pursuing my long-dissuaded desire to hack around with physical computing…
Read more…