The Artima Developer Community
Sponsored Link

Weblogs Forum
The Adventures of a Pythonista in Rubyland/1

4 replies on 1 page. Most recent reply: Oct 30, 2008 11:41 AM by robert young

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

The Adventures of a Pythonista in Rubyland/1 (View in Weblogs)
Posted: Oct 11, 2008 11:55 PM
Reply to this message Reply
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


Miguel Angel Hernández Orozco

Posts: 6
Nickname: migsho
Registered: Sep, 2007

Re: The Adventures of a Pythonista in Rubyland/1 Posted: Oct 18, 2008 4:13 PM
Reply to this message Reply
Im looking forward for this posts.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: The Adventures of a Pythonista in Rubyland/1 Posted: Oct 29, 2008 10:13 AM
Reply to this message Reply
>> I'm a natural toolsmith and lean towards declarative systems and a compositional style.

Then why not Prolog and/or RDBMS? Why get bogged down in so much code?

Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: The Adventures of a Pythonista in Rubyland/1 Posted: Oct 29, 2008 12:51 PM
Reply to this message Reply
> >> I'm a natural toolsmith and lean towards declarative
> systems and a compositional style.
>
> Then why not Prolog and/or RDBMS? Why get bogged down in
> so much code?

Prolog? Are you trolling? Yes I could learn *another* language but where is it deployed that I could use it? Ruby is included with OS/X and SilverLight.

RBDMS - yes, when appropriate I push logic into declarative query statements rather than code loops. A significant refactoring I was recently complimented on for one client would be a good posting I'll have to write up later.

However, I've not heard of people using RDBMS for code generation, text mangling or XML processing recently :-)

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: The Adventures of a Pythonista in Rubyland/1 Posted: Oct 30, 2008 11:41 AM
Reply to this message Reply
> However, I've not heard of people using RDBMS for code
> generation, text mangling or XML processing recently :-)

Andromeda, LittleSteps, JAG, Rails to name a few that do code generation from the catalog to a greater or lesser degree.

This is a list for Python:

http://www.codegeneration.net/generators.php?page=9

Flat View: This topic has 4 replies on 1 page
Topic: The Adventures of a Pythonista in Schemeland/1 Previous Topic   Next Topic Topic: Continuous Integration Hell

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use