The Artima Developer Community
Sponsored Link

Thinking Upside Down
The Adventures of a Pythonista in Rubyland/1
by Andy Dent
October 12, 2008
Summary
Inspired by the Adventures of a Pythonista in Schemeland series and being engaged in my own learning experience, here's the start of a series by a language geek with about 18 years of OO development experience, trying to get to the heart of Ruby.

Advertisement

I've recently started doing enough work in Ruby that I felt I'd justified needing to become an idiomatic programmer in Ruby. It's been a long-held ambition since I read Martin Fowler's rave about Ruby and then the book Code Generation in Action.

The projects that justify it are a rewrite of the AppMaker code generator, the need to write scripts for a new client who also has Ruby on Rails developers (and no trace of Python) and a faint ambition to script Google Sketchup which I'm using for carpentry and DiY projects.

The choice of Ruby vs Python for writing code generator templates generated some comment last time I raised it. I basically came to no conclusion other than nervousness over Python whitespace vulnerabilities. I decided I needed more real experience with Ruby to educate my gut.

Background

I've been a software developer, with a few forays into system management, for about 25 years and much of that in object-oriented langauges, leading a Macintosh-originated trail through:

  1. Object Pascal (the Apple/Wirth version)
  2. Think C (simplified C++)
  3. C++
  4. Objective-C
  5. Python
  6. REALbasic
  7. C#
  8. Ruby

I'm using all bar the first two concurrently for various clients.

I've dabbled in Smalltalk along the years due to fascination in OO thinking and desire to self-educate but not managed to find a client project where I could use it for serious development. I'm also a fan of Smalltalk-style IDEs.

On the topic of IDEs, whilst I sit with a terminal window and irb running to test expressions, I'm more comfortable with some kind of GUI IDE and so I'm using Komodo. As I start exploring IronRuby I will be looking for Visual Studio integration of some kind. Part of my justification for wimpishly using IDEs is that I have to live in an IDE environment for much of my desktop development and it's easier to keep an IDE mindset than to flip between using an IDE and thinking command line.

My main Python use has been testing infrastructures and writing complex XML processing and generation code in the OGC standard geospatial information world. I've become fond of mixing XPath expressions with simple iterative logic, as an alternative to XSLT. I fell in love with the Haskell-inspired list comprehensions and generator expressions.

I'm a natural toolsmith and lean towards declarative systems and a compositional style. This is the bias I take into Ruby. In particular, I'm looking for how to move my Pythonic style of data processing into Ruby idioms.

Resources

Martin Fowler on Ruby: http://martinfowler.com/bliki/EvaluatingRuby.html

The Pragmatic Programmers: Programming Ruby: http://www.pragprog.com/titles/ruby/programming-ruby

Code Generation in Action: http://www.codegeneration.net/cgia/

Why's Poignant Guide to Ruby, if you like the surreal approach to language philosophy: http://poignantguide.net/ruby/chapter-1.html

Talk Back!

Have an opinion? Readers have already posted 4 comments about this weblog entry. Why not add yours?

RSS Feed

If you'd like to be notified whenever Andy Dent adds a new entry to his weblog, subscribe to his RSS feed.

About the Blogger

Andy is a free-lance developer in C++, REALbasic, Python, AJAX and other XML technologies. He works out of Perth, Western Australia for a local and international clients on cross-platform projects with a focus on usability for naive and infrequent users. Included in his range of interests are generative solutions, software usability and small-team software processes. He still bleeds six colors, even though Apple stopped, and uses migration projects from legacy Mac OS to justify the hardware collection.

This weblog entry is Copyright © 2008 Andy Dent. All rights reserved.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us