1. links for 2006-06-30

    June 29th, 2006

  2. links for 2006-06-29

    June 28th, 2006

    • “By our best estimates, over 90% of the 550 people at RailsConf 2006 are using Apple laptops.

      We decided to reward those willing to take a stand against the norm and compute different.”

    • DDH’s presentation Resources on Rails. Doing REST the easy way, handling different media formats and using ActiveResource.
  3. Heartbeat: Control Panel for Rails

    June 27th, 2006

    heartbeat.png

    When it comes to managing co.mments, simple is definitely better. Four things I worry about:

    1. Deploying new code.
    2. Monitoring the service.
    3. Database backup.
    4. Other odd tasks.

    Capistrano takes care of deployment. I run the test cases, push new code to SVN, and reload it on the server with a simple rake deploy. If you’re not using Capistrano, you’re working too hard.

    For monitoring, I use Nagios. It’s a pain to configure initially, but once you get it running, it’s bullet proof. Special thanks to Barry for helping me set it up (and so many other admin tips).

    Database backup is same replicate and upload to separate server.

    Which brings me to odd tasks. There’s quite a few of these. Retrieving logs, cleaning up sessions, monitoring vital statistics, restarting stuck background processes. They’re all easy to do with Ruby, in fact Ruby is a wonderful scripting language with a lot of one-line solutions to common problems.

    There’s two options for running these odd tasks. Using SSH to execute commands remotely, which works great from any machine. And using rake remote:exec (Capistrano), which essentially does the same thing but with better packaging.

    And now we have Heartbeat.

    Developed for Rails Day 2006 by the Highgroove Studios team, Heartbeat is Nagios meet Capistrano remote:exec, managed from a friendly Web UI. It’s a breeze to setup, intuitive to use, and … who said management tools can’t be sexy and fun?

    And it’s running rake on the server, so besides test cases and migrations, you can write as complex tasks as you want to and plug directly to your Rails app.

    Best thing, you can use it from the Highgroove Heartbeat server. Or you can grab it fresh from SVN and run it on your server. It’s open service and open source.

    Here’s Derek Haynes’s announcement post. Check out what they’re doing at Highgroove, I’m sensing a lot of good stuff coming up.

  4. links for 2006-06-28

    June 27th, 2006

  5. Rails at it again: REST and ActiveResource

    June 27th, 2006

    Turns out Rails 1.2 will be more REST friendly than it already is. Scroll to the second half of this post:

    We’re moving beyond GET and POST in Rails 1.2 - it’ll be done by doing some hacking in terms of setting an HTTP header with the HTTP method we want to actually invoke (since HTML doesn’t actually support PUT and DELETE).

    OK. That’s mildly interesting, mostly a little bit of frameworking around your controller that uses resources and a common set of verbs. So?

    Turns out, good things happen to those who let the framework worry about doing URLs right. (Read Elliotte Rusty Harold‘s post to find out why)

    With Rails 1.2, all you have to do is:

    map.resource '/person'

    Easier that writing this blog post. And with one line you’ve enabled all that is good about the Web, the friendly permalinks, the searching and caching, the quick path to mashing.

    Did I just say mashing? Here’s the other exciting part. Rails 1.2 also brings up ActiveResource, an easy way to create APIs around each of these resources. Two lines of code, and you’re signing and talking Web services.

    If SOA is the next big thing, Rails 1.2 may well make it the next simple things.

    Update: Here’s a link to the presentation (PDF) and the post on Loud Thinking.

  6. Time Breakdown of Modern Web Design

    June 27th, 2006

    Another one that would be funny if it wasn’t so true.

    Via Linux and Open Source blog.

  7. links for 2006-06-26

    June 25th, 2006

  8. Managing management

    June 25th, 2006

    The two poles of software development:

    Release early, release often.

    Do it right.

    Both are intended to make people’s life easier and better.

    If you release early and often, you can get users involved in the development process. No matter how smart you are, there are features you didn’t think of that will only come up once people actually use the software. And there are great features that just don’t matter to anyone.

    You can’t do great design by capturing all the requirements upfront. You can only plan in detail for mediocre software. Great software builds on experience, and experience builds as people are starting to use early releases.

    Treat this as a law of nature. You can’t break it, no matter how often people try.

    But there’s a problem with half solutions. Crappy software tends to work for a while, and then go up in flames. You’re losing a lot of data, you can’t keep up with load, or the hack-upon-hack-upon-hack becomes unmaintenable nightmare. At some point you just can’t get it stable, or add new features, without a rewrite refactoring.

    If you want the code to survive, if you want happy users for the long term, you need to do it right.

    Those are two poles, but they don’t conflict. If you plan your development process right, you can do both at the same time. You release early, iterate, release often, refactor, and eventually get it right. You get all the features that matter, some you didn’t even think of, stable code that’s easy to maintain.

    It’s just a matter of picking the right process.

    And getting management to agree.

    That’s the biggest challange in software development. Behind every developer, there’s a bean counter and an eager sales person. And they want to defy the laws of nature.

    Management wants software done right, so it never shows any flaws. Of course, you know it will be mediocre software because you know you don’t know all the requirements upfront without getting users involved. You’ve done it long enough to realize that customers don’t know what they want until they see it. Requirement documents don’t mean anything.

    Management wants software done now. If there’s any way to get an early release, they’ll take it and sell it as a done deal. I call it “prototype lock-in”. If the prototype, held with duct tape and spit, looks close enough to the real product, it will be the real product. And damn the maintenance costs.

    Management budgets 80/20 in relative dollar amounts. But we all know that getting 80% there takes 20% of the effort. Once it’s that close to being finished, it’s actually far away from being done.

    The trick, as Sterling Camden puts it:

    The key is to prevent the company from releasing either of the first two versions without being able to retract them at a later date.

    So how do you get management to understand the laws of engineering without trying to defy them through creative accounting? How do you prevent your project from becoming another Enron?

    Chad came up with one idea:

    Alternatively, if you have the sort of boss or client that likes to think (s)he is cutting-edge and hip to the New Thing, all avant-garde an’ stuff, you can just throw around phrases like “agile programming” and do the “iterative organic project evolution” thing. It’s a little like prototyping and refactoring beta testing and doing proper project design to varying degrees from day one to delivery.

    What do you do to cheat clue management into the reality of software development?

  9. Debuggers are no excuse for sloppy code

    June 25th, 2006

    Mike Bowler uses debuggers as last resort:

    I find that, for myself, relying on a debugger leads to sloppy thinking. When I start single stepping through code, I’m reacting to what individual lines are doing and I’m not thinking about the bigger picture. The debugger throws massive amounts of information at me and I’m forced to sift through it to find the tiny details I care about.

    When I don’t use a debugger, I’m forced to actually think about the code rather than just reacting to it. I’m forced to think about how it works and what could possibly be going wrong.

    I agree with Mike. Relying on debuggers is a bad development strategy.

    Good debuggers take a lot of effort to develop, and years before they hit the market. If you need debuggers, you’re dommed to the tail end of technology. Not necessarily a bad thing, but not an option for me.

    Good code is code you can troubleshoot when running in production mode on a hosted server half a world away. If you need a debugger to troubleshoot your code, how can you react to problems in real time?

    Using debuggers as excuse to write sloppy, undocumented, badly structured code is not good engineering. Would you like your car to have an hydraulic self-lifting jack, or tires that don’t give up easily?

    Developing a strategy for writing better code that is easy to diagnose takes some upfront effort, but pays big time in the end.

    (Since Mike is talking about Ruby, I have to point out Ruby does have a debugger, and so does Rails. I just never used them, never will)

    Via Raganwald.

  10. Be safe out there.

    June 24th, 2006

    I just saw a guy fly 10 feet up in the air. Land on his back. Deep cut on his face. No bleeding. No pulse.

    So be safe out there.