File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ruby and the fly likes Rails uptake time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Rails uptake time?" Watch "Rails uptake time?" New topic

Rails uptake time?

Gustavo Quiroz

Joined: Nov 08, 2004
Posts: 12
Hi. My question is:

How much time (hours) do you think a competent java programmer (e.g. a certified one) needs to invest in order to be productive using Rails and what topic(s) do you think are the most difficult for him to address?

Thank you.
[Edit to provide meaningful topic - Dave]
[ January 30, 2007: Message edited by: David O'Meara ]

=============================<br />Gustavo Quiroz<br /> <br />CSM <br />IC SOA Associate<br />ICAD (RAD 6.0)<br />ICED (WSAD V5.0)<br />ICSD (MQ V5.3)<br />ICSD (XML/WSAD V5.0/MQ V5.3/Portal V5.1)<br />ICSA (WAS ND V6.0/WAS V5.0/Portal V5.1)<br />ICAD (WSAD V5.0)<br />ICAD (DB2 V8.1)<br />ICDA (DB2 V8.1/DB2 V9)<br />SCJP (V1.4)<br />=============================
nhm tanveer hossain khan

Joined: Sep 09, 2006
Posts: 1
"...How much time (hours) do you think a competent java programmer..."
- 1 night (2 to 4 hours) to learn Ruby, i don't know about "a certified one", but for me it took this time.
- 1 night (2 to 4 hours) to learn Rails.
- 1 night for a small project.
sum = 3 nights to become a Ruby on rails developer

"....are the most difficult for him to address..."
i think the syntax itself. you can't predict which type of method or property name is going to be used. more over it has virtual property support. you can't get any clue what are the properties of a domain model object. unless you go through the database table.

for example:
class Category < ActiveRecord::Base

you can't predict, what are the "property" inside "Category" object.

more usually in java:
class Category {
private String name;
// setter getter
you can get the hints.

NOTE: this is not a limitation, it is an excellent feature. it helps a lot to adopt any changes from your real database table.

best wishes for your Rails journey ...

------------------------------------<br /> nhm tanveer hossain khan ( hasan );<br />------------------------------------
Justin Gehtland
Ranch Hand

Joined: Jan 30, 2007
Posts: 31
I think that the *syntax* of Ruby is quite easy to pick up, though the *idioms* will take longer. Things like the extensive enumeration support, multiple ways to pass blocks, and the ability to bind procs to local state all take some time to make a normal part of your code.

When you tack Rails on top of it, the other mind-shift you'll have to make is to the conventions Rails uses for naming, routing and persisting. It can be difficult to tease out, sometimes, what is a feature of Ruby, and what is a feature of Rails. A good example of this is the Rails inflection mechanism (which turns "MyObject" into "my_objects" but "Person" into "people").

The switch shouldn't be too bad, though. I think the previous poster might be an outlier to the "fast" side of the curve, but the standard will be closer to that than to, say, 6 months.
Terry Jeske

Joined: Apr 06, 2004
Posts: 17

I tried to pick up RoR before, and kind of got disenchanted with the Ruby language (loved active record however). I think this disenchantment started when the author of the book began to use a lot of ruby short cuts, which made the code a bit more cryptic. I have also noticed that many ruby developers tend to like to show how concise they can be, in lieu of easy to follow code. What path does your book take? i.e. Do you err on the side of legibility when providing examples?
Justin Gehtland
Ranch Hand

Joined: Jan 30, 2007
Posts: 31
We've tried very hard to do two things with the code samples in the book:

1) making the code structured in such a way as to be familiar to a Java programmer, while at the same time...
2) making the code conform to standard Ruby idioms

For example, here's a sample from our XML chapter showing how to use REXML to pull elements from a target document.

A Ruby fanatic might "simplify" the code into:

Both of those are idiomatic Ruby, but the former is much more legible and represents the style of the code in our book.

(*note: the second code sample I just re-wrote off the top of my head, so if I typed it incorrectly, well, sorry. ;-) )
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
...or you could go in the middle and make the latter a bit more readable:

or even

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: Rails uptake time?
It's not a secret anymore!