Ruby on Rails starter II / II

Ok, after quite some hours of work I got a grasp of both Ruby and Rails’ basics. In addition to the links I already mentioned, I found the RubyOnRails API also very useful.

Some results:

reviewer ruby on rails app

reviewer ruby on rails comment

I took an extra 20 minutes to add the logo. Only because I was making screen shots for my blog πŸ™‚

I’m really tired, so some quick notes.

  • Yes I like the quick way of working with Ruby on Rails
  • No I do not like the freedom Ruby gives. I’m coming from Python and really find the Python coding guidelines very valuable. But let’s not go into that.
  • I’m positive about the framework. It did what it promised. But the ‘perly’ way of indicating variables really held me back: ‘product’, ‘:product’, ‘@product’ and ‘#{product}’ can all reference some product, depending on the context.
  • Before deciding on wether I really want to dig deep into RoR, I want to evaluate Subway, a framework insprired by Rails. It’s written in Python, which gives it a large advantage over Ruby on Rails. Sorry about that πŸ˜‰

    Update 2006-01-09 23:01h: Colleagues pointed me to TurboGears. Another python framework “much like Rails”. My todo list is growing…


    3 Responses to “Ruby on Rails starter II / II”

    1. FrederickRos Says:

      Hum … Glad to see you like RoR …

      However, I do not agree with the term ‘perlish’ regarding variables naming … In Perl, sigils describe the type of the variable (list, hash, scalar …) although in Ruby they just determine the scope of the variable …
      Moreover in your example, you just give 2 different variables use: @product and product. The 2 other ones are either a Symbol and a string, evaluating the product variable …

      My .2 $

    2. nederhoed Says:

      Merci Frederick, I will invest your .2 $ and hope to be able to give you back much more some day.

      Indeed it differs from Perl. It still looks perlish though πŸ™‚

      No, you’re right. the ‘:product’ puzzled me. But it’s not a variable. Maybe you could point me to a place where the ‘:…’ is explained. Google ignores ‘:’ in my query for Rails wisdom.
      The sentence about referencing a product will be corrected once I really understand why it is incorrect.

      Thanks again for the feedback!

    3. raichu Says:

      :something is a symbol in ruby. there’s guaranteed to be only one object for a symbol. comparing symbols is faster than comparing strings. you might wanna check out and other “ruby symbols” google-ables. technically, you can use anything for a key, but hashes in rails usually use symbols for keys.

    Leave a Reply

    Please log in using one of these methods to post your comment: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )


    Connecting to %s

    %d bloggers like this: