Blue and gold Cloud patterns Dawn at the pier Abstract weed Capybara

8th September, 2004

Ruby Tuesday

Filed under: Technology, — bsag @ 04:09 PM

I’m firmly of the belief that you can never learn too many programming languages1. For one thing, each new language you learn teaches you more about the general principles of programming, which aren’t specific to any one language, and makes you think about general problem-solving approaches. Also, no one language—even my beloved Perl—is perfect for every eventuality, and all have their strengths and weaknesses. So recently, I’ve been looking at Ruby. A comment by Nathan mentioned a review of TextMate, which in turn put me on to Rails—a web application framework for Ruby.

I haven’t had time to look at the language in depth, but I like what I see so far. It’s a neat language, with some of Perl’s slightly terse syntax and flexibility, but with very solid object orientation. There’s a package management system (RubyGems) which makes it really easy to install and package code. There’s also a very neat self-documentation system rdoc which produces command line and HTML documentation from well-commented code. What really knocked my socks off though was Rails. There’s a movie here which shows David Heinemeier Hansson (the creator of Rails) using it to conjure up a working weblogging engine, seemingly out of thin air. The structure seems really easy to use, and suitable for everything from a simple application to access a database to a huge web application. This got me thinking. I’ve been giving serious consideration lately to building something web-based to administer Mr. Bsag’s paintings. Every time he has an exhibition, we end up trying to generate a catalogue manually, matching up paintings, prices and titles. It’s a real pain, and we inevitably make mistakes. I can imagine setting up a database record for each painting on MySQL with an ID number (which would be written on the back of the frame), a title, price, details of media and size and also a digital image of it. Then we could access and administer these records via a web interface, and generating a catalogue of a selection would be a piece of cake. It seemed to be a job that was too big for my limited PHP knowledge, but with Rails, I can imagine that I would fairly easily be able to put something together. Ruby doesn’t have the user base of something like Perl or PHP yet, but I’m beginning to see that it has a lot of merits.

1 This is one half of my version of the saying, “You can never be too rich or too thin.” The other half is, “You can never have too much music.”

  1. 1

    Welcome to the Ruby on Rails world. Your pilot project sounds like a really good way to get going with the framework. Do come hang out at #rubyonrails on FreeNet once you get started. It's much easier to start when you can get help understanding the first few issues you'll invariably have.----- I did have a slightly ulterior motive when I posted that, I'll admit. I almost started talking about Rails right then and there... but then thought I'd let the video speak for itself. wink

    I've never had the patience for real development--shell scripting (ksh) is the most I'm really able to do well. Rails makes it easy enough, though, that I've started on a half-dozen projects myself. I'm still trying to dive into the particulars: the documentation is rather sparse, but the community is very, very welcoming and patient.

    by Nathan @ 09/09/2004 7:10 am • Permalink

  2. 2

    you've probably already read this, but well worth 5mins if you haven't: http://www.linuxjournal.com/article.php?sid=3882

    a proviso re multi-languages: i agree with you completely in the real world. however when getting a job the majority of agents & HR people regard non-specialisation as indicative of lower competence. just something to bear mind when writing your cv

    by Saltation @ 09/09/2004 10:10 am • Permalink

  3. 3

    David Heinemeier Hansson: Thanks! I'll stop by the IRC once I've got a little further with it. At the moment I'm trying to understand how the whole model-view-controller thing fits together. Oh, and I'm learning Ruby grin

    Nathan: Ooo, that's slightly evil, but I'm glad you introduced me to it anyway :-D You're right—the movie does speak for itself.

    Saltation: I hadn't read that article, but I do know a bit of Python (a very little bit). For some reason, it never really suited me, for reasons that I can't quite explain. Interestingly, Matz (the creator of Ruby) makes the point in interviews that he wasn't a) trying to make a perfect language (because there isn't one), and that b) programming is very personal, and you have to find the right language for you, which won't be the same as everyone else's. You can read more here.

    As for jobs, I'm in the happy position now of not needing to programme for work. As a biologist (and not a bioinformaticist), I don't need to programme for work, but I can bring it in if I want, to improve my workflow. Basically, nobody cares how I achieve things, so long as I get some good results. grin

    by bsag @ 10/09/2004 5:10 am • Permalink

  4. 4

    I laugh at the difference between us! The database for the artist in residence in this household was obviously a job for ... AppleWorks. The main advantage is that it's easy to use, so the artist can spend hours entering data, measurements, etc (otherwise I'd have to do it). AppleWorks is also, compared with some of the other database apps I've seen, good at designing reports - catalogues, price lists, and so on. However, using AppleWorks will do nothing for your geek credentials, and I can see that there are many advantages to doing it yourself! And I'll watch your progress with interest. And then there's Python...

    by pete @ 10/09/2004 7:10 am • Permalink

  5. 5

    Thank you. I strive to be slightly evil. :D I also knew that Ruby and Rails would be just the type of thing that you'd dig.

    I also know how you felt about Python. When I first started looking at it, I thought it'd be the perfect language for me. The ease of a shell script, but with the pure object-orientation that I've come to appreciate it. I imagined myself designing well-crafted objects and applying them to the scripts I would use for systems administration. I have more than a few very complex scripts that would benefit from that. So, I bought a few books on Python and sat down to convert one of my favorite scripts to Python.

    I never completed the project. Python just didn't do it for me. I felt like the task of programming was contrary to the goal I was trying to accomplish. Ruby, though, fills the gap very nicely. It has exactly what I was looking for in Python.

    by Nathan @ 10/09/2004 7:09 pm • Permalink

  6. 6

    pete: Hehe grin For some reason, I've never been able to properly get to grips with Applescript. I can do simple things, but anything more complicated just defeats me. I don't have a copy of Appleworks either, which doesn't help grin

    Nathan: It is exactly the kind of thing I dig. grin All I need now is a bit of time to read the manuals...

    by bsag @ 12/09/2004 1:10 pm • Permalink

blog comments powered by Disqus

Powered by ExpressionEngine :: © www.rousette.org.uk, 2002-2008 :: [XHTML] [CSS] [508]