Some thoughts on software design

Posted by yossarian

We’re still hard at work on Hyperactive, a content management system for independent news production, and we’ve started to get a lot more people working on the software. So, at this point it seems to make sense to lay out some software design guidelines. Since we’re building software with a non-corporate purpose, let’s think outside of the normal scope of corporate “agile” manifestos (“delivering more value to your client”) and take some design inspiration from a different sphere: Soviet assault rifles.

Despite the rather poor reputation of Soviet technology these days, those guys had some stuff figured out when it came to design. Consider the AK-47 assault rifle designed by Mikhail Kalashnikov. It’s simple, and rugged. It takes a beating, refusing to jam even when it’s been exposed to mud, dirt, or hasn’t been maintained properly. The trigger guard is huge, so it can be fired even by gloved users in Arctic conditions. It can be maintained, and even manufactured by, people with access to simple machine tools.

A news website and an assault rifle might seem like completely unrelated areas of systems design, but let’s think about users for a moment. They’re trying to produce news, sometimes under stressful conditions. Maybe they just got in off the street after getting tear-gassed. Maybe they’re tired. Maybe they’ve got 20 things to do and their boyfriend has just been arrested. These people don’t want to screw around with anything too complicated. They want something that works.

This also goes for another set of users: the people who install and maintain the software when it’s running on production servers. The lower the number of software dependencies, and the less screwing around when it comes to installing, maintaining and upgrading the software, the better.

So, when you’re working on software, and you’re faced with a design choice, ask yourself the simple question:

“What would Kalashnikov do?”

Hyperactive::SSL, Action Alerts

Posted by yossarian

Things are moving along a bit more slowly than I’d like but still steadily. The code is now nearly ready for a 0.1 release. This week’s improvements include:

  • The use of the SSL Requirement plugin so that the login, admin area, and publishing functions of the site all require SSL. Attempts to use the site in a production situation without an SSL cert will currently fail.
  • There is now an “Action Alerts” content type which allows site administrators to publish short messages at the very top of the content on the front page (and exports a list of action alerts as RSS too). This can be used in a “breaking news” situation.

There has been some talk of Twitter integration for the action alerts, I am still thinking about how to acheive that without making the site absolutely require Twitter or any other external commercial service.

When i’ve gone over the code somewhat in a cleanup session, improved the documentation a bit, and packaged a release, I’ll write up a blog post to let people know that a first release is available.

Hyperactive :: Caching, Localization and Comments

Posted by yossarian

Another round of development on Hyperactive is nearly complete. In this round of features, we’ve concentrated on getting the code ready for production use. This has consisted mostly of the following tasks:

  • caching
  • localization
  • the ability to leave comments

Hyperactive :: Video Improvements

Posted by yossarian

We’ve been hard at work on the Hyperactive codebase for the last few months, it’s probably time to post an update here. This release was code-named “Planet Male Madness” in tribute to one of the greats in the Indymedia movement.

Recent development effort has been spent mostly on video. If you take a look at a video page on the development site you’ll notice that there are lots of new features available.

A non-Jedi approach for new Rails coders:

Posted by yossarian

Second in our “friendly web programming” series, this installment starts with a pop-quiz for new programmers. If you’re trying to learn programming for the first time, you’ve got a whole lot of unfamiliar stuff to think about, and most of the time you don’t understand at least half of what’s going on. In such a situation, which of the following two options would you like to be presented with when you are trying to learn web programming?

Video Conversion in Ruby on Rails

Posted by yossarian

It’s not tough to set up a video-encoding facility in Rails. Here’s a quick run-through with some code examples.

Video encoding is a long-running process and you don’t want to have to wait for the video encode to finish before the web-request can complete. One strategy to avoid having extremely long web-requests is to have Rails hand off the encoding job to BackgroundRb, a job-scheduling server which does long-running work in a separate thread. The same thing could be accomplished in most other web-languages by spawning a new thread and doing the work, but BackgroundRb gives us a bit of extra love: if multiple users upload a whole bunch of videos at the same time, BackgroundRb will queue them up and work on them in sequence so the CPU doesn’t go through the roof.