Ruby on rails has derailed!

Well iv been bugged by a colleague to try out ruby on rails,from what I can tell, its good for quick development, but its pretty useless,and dosent follow OO principles, or any proper guidelines, from what I can tell(this is all taken from the http://tryruby.hobix.com/webby) :

Whats to_s ? Why is there an underscore there? Why isn’tit capitalised? And what is reverse? Surely you mean Reverse ?

to_i ? to_a ? This is the 21st century, were notrunning low on disk and memory space, you can use full variable names likeToString and ToInteger

I wonder what happens if you try to convert a string to aninteger?

0? HAH! Surely it should throw some kind of error?

Is there a point to the ! then, if it just ignores it?

But it seems if you don’t put a space between new andthe {, it just ignores you

To me at least, it seems like a really silly language. Itdosent follow any proper rules, in  my opinion, its just something fun todo.

You can Leave a comment here!

Comments

  1. a 8/1/2007 1:13 PM
    Gravatar
    >Surely you mean Reverse
    Why do you think method names have to be capitalized? Many other languages don't, like Java for example. Actually, not capitalizing seems quicker to type.

    >Is there a point to the !
    The ! line modified ticket and also returns it. The line without it just returns a copy of ticket that has been modified. The side effects are different, even if they return similar looking results.
  2. Monty 8/2/2007 3:05 PM
    Gravatar
    >Why do you think method names have to be capitalized? Many other languages don't, like Java for example. Actually, not capitalizing seems quicker to type.

    Method names should be capitalised, so that they are easier to read - accessdatabasestructurefrommedia vs AccessDatabaseStructureFromMedia, most formal coding guidelines tend to agree with this notion too (well, from what I have read anyway). It maybe easier to type, but so is r, or just _, but its not that readable. Code tends to be written once, but read many more times than that.

    >The ! line modified ticket and also returns it. The line without it just returns a copy of ticket that has been modified. The side effects are different, even if they return similar looking results.

    Fair enough, that wasnt explained, and I didnt have enough time to dig around to find the answer.
  3. Matijs 8/9/2007 5:33 PM
    Gravatar
    > Method names should be capitalised, so that they are easier to read

    A much used (though not in C# or VB.NET) other option is to separate words by underscores, as in access_database_structure_from_media. That is the method used in Ruby.

    > I didnt have enough time to dig around to find the answer.

    Maybe if you took a little more time you would find that Ruby, although very different from C#, is actually a very nice, very OO language.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.

Please add 8 and 7 and type the answer here: