Archive for the ‘Programming’ Category

Loving Rails

Tuesday, June 27th, 2006

I’m really getting into Ruby and Rails now - I don’t think I’ve touched a PHP script for over a week now (and this for someone who’s been writing PHP apps for six years!).

Obviously my job is as a PHP developer, but I’ve been fortunate enough to get my current project going in Rails rather than PHP so I’ve even been using Rails at work. That’ll change shortly as an existing client has some major additions to be made to the PHP-based system I wrote for them and I’m actually kind of dreading having to make the changes in PHP.

As much as I wrote the system to be as extensible as possible, the rapid prototyping and then main development possible with Ruby on Rails really gets you used to the good life. It shouldn’t actually be that bad as the system I wrote is reasonably similar in structure to Rails and even goes further in some parts (full form-building code), but there are certain things that either Ruby or Rails just make simpler (and quicker) than anything you can do with PHP (and I didn’t think I’d ever say that).

In my spare time I’ve been working on a content management system in Rails, primarily for two related projects, but also hopefully as a general system I can re-use on more websites. The speed at which I’ve been able to build it up is great, to the point where from a few weeks of programming where I get a bit of spare time here and there I now have a basic CMS handling logins, dynamic menu/sitemap generation, calendar system, news, general content pages, swish permissions back-end admin and even the beginnings of a file/image manager to be incorporated into TinyMCE to help non-techy authors who’ll be working on the finished websites.

The two websites in question are the Maserati Resource Centre (a non-commercial info resource and community for Maserati enthusiasts run by my Dad) and The Maserati Club (the international club). Both sites are in need of a serious update and I’ve re-designed them both as well (TMC site in conjunction with Andy Katz), but it’ll still be a month or two before the CMS is ready for either to go live.

In the meantime, I’m enjoying getting further into this Rails lark and building up what will hopefully be a very nice content management system when finished. I’ll post little screenshots once it’s a bit further along, though I’m trying to keep both site designs largely under wraps, so they’ll be more snippets than full screens.

At last, Ruby auto-completion!

Wednesday, June 21st, 2006

Komodo, an IDE I looked at a couple of years ago for PHP before settling on Zend Studio, recently hit version 3.5 and introduced support for Ruby and Ruby on Rails.

I’m checking out the 21-day trial at the moment and it seems pretty cool so far, so if it continues to impress over the next week or two I might go for a personal licence and start using it at home instead of RadRails (at least until RadRails can introduce a few key features like window splitting and code auto-completion).

Komodo still isn’t the perfect Rails IDE for me, but it looks like it could be the best so far. A few things that could make it near-enough perfect (for me at least - others will have different requirements):

  • Whole-project class/method/variable mapping
    The Code pane on the left is useful, but as with every IDE I’ve used bar the excellent Zend, it only lists code from files you actually have open to edit. Zend maps all the code in your project so that you can quickly jump to a class, variable declaration or function anywhere in your app without having to remember which file to open first.
  • Unlimited window splitting/cloning
    Komodo lets you split the window once, which is better than RadRails’ none, but again Zend offers no limit. jEdit actually does this even better by allowing more control over where the splits occur, making it easier to get a setup that fits your needs.
  • More Rails integration
    This is the one area RadRails trumps all - the ability to start/stop WEBrick servers and run generators from within the IDE. At the moment in Komodo I need a command prompt open to run the WEBrick server while coding to test locally and when I run a scaffold or similar generator I then have to tell Komodo to re-import the new files as it doesn’t notice them appearing
  • I had more but I’ve been doing other things while writing this and I’ve forgotten them. Guess they’ll have to wait for another post :)

Komodo is $29.95 for the personal licence and $295 for the pro licence, so not too bad for non-commercial use but I think I’ll have to wait a while before getting a pro licence to use at work.

Stop the beeping

Tuesday, June 13th, 2006

Via Vitamin, I just read a very good blog post by Matt Mullenweg about the beeping in his house. He came back from a trip to find an irritating beep every minute or so, but didn’t fix it for days.

The gist of the post is about how engineer-types are able to block out irritating noises or problems after a short period of getting used to them. Matt put up with a smoke alarm going off every minute for three days, happily getting on with his work and simply taking calls in another room, before finally getting that new 9-volt battery.

He ends his post by suggesting everyone go and check through their blogs/web apps/whatever and find the ‘beeps’, then concentrate on them and get them fixed. The point here is that we tend to start blocking out small irritations along the way when developing code (in order to concentrate on the important stuff) to the point where we’ve forgotten they were problems in the first place. That’s obviously not good for your finished product, so going back through and re-finding all the beeping noises will allow you to properly polish your system.

We’ve all seen these kinds of little irritations in either our own apps or others’ (e.g. flickr’s previous lack of a page to just find the newest comments on your posts) and Matt’s post provides a great analogy and reminder to get them sorted and improve user experience.