

Zero to Riding the Rails in Four Months - moorage
http://hackd.wordpress.com/2007/10/14/zero-to-riding-the-rails-in-four-months/

======
Tichy
I thought it only takes a few days to write a web app in Rails (minutes
actually). OK, humor aside - I am coming from Java and trying to pick up
Rails, and I have to say, I am really not that enchanted. Many things in Rails
just seem extremely ugly when you are used to the clean Java code. Passing
everything around in Hashes does not seem elegant to me, and I wonder how Code
completion is supposed to work with that. Maybe if you know the whole Rails by
heart, it is OK and you don't need completions, but I am lazy. Java is not
that ugly - it might look like a lot of typing, but actually most of it is
done by Code completion/Code generation these days. Spring also offers quite a
few "Code by Convention" features, so it is not that much harder than Rails.

For example with Java annotations, I only have to press ctrl+space in Eclipse
above a variable in a model, and it gives me the options for mapping all sorts
of things with hibernate (ie many to many etc). Much nicer than looking things
up in a book. Presumably it would be possible to set up the Dev Environment to
be able to offer completions in the rails migrations, but that would be a hack
- in Java, it follows from the types... Oh and btw, isn't it ugly to have the
model code distributed all over the place (migrations, model, database
schema)? I'd rather have it all in one place.

Internationalization seemed very fishy in Rails, too, from what I gather from
"Agile Rails".

Anyway, sorry for the rant - I really have to force myself to complete at
least one Rails application, but my expectations are rather low. At least
perhaps I can appreciate Java again afterwards...

I like Ruby, but the reality is probably that in a typical Web Application,
it's features don't come into play that often. It's mostly CRUD, after all...

~~~
ardit33
Tichy, Hibernate is aweful.

Ruby is just PHP 2.0, or at least it seems that the same crowd that sweared by
PHP few years ago, are attracted to it and "have seen the light". Every
beginner is a "Rails" expert now. Same people, same crap will come out.

~~~
davidw
I have a different take on Rails. It's actually something that has attracted a
lot of interest from Java people sick of writing too much code, as well as
scripting language people who want something that's relatively clean, that
basically utilizes a lot of best practices in one bundle.

I like it a lot, and do not consider myself one of the "crap producing PHP
crowd".

Also, how can you equate Ruby to PHP? They're very different in terms of
philosophy and design. Ruby has all kinds of nice language features that make
it a pleasure to use. PHP basically borrows things from here and there, and
was never a very "inspired" programming language.

~~~
hello_moto
In general, people like to do things faster to achieve the result ASAP. Most
people have a short patience level.

Why do you thing startup is using Rails? because they want to get rich fast by
throwing their simple products faster.

People can't wait for 8 months to see their work comes to fruition.

Basically it's human nature to like Ruby on Rails, not because of the
technical merit.

~~~
davidw
Given what we know about program length vs bugs (it's pretty linear), I think
it's a "technical merit" that Rails lets you write shorter, clearer code. In
an environment where you're not sure what you're doing is going to go
anywhere, and where you need to be able to turn on a dime, shorter, clearer
code is also going to be an advantage.

------
jsjenkins168
There should be a clear distinction between Java web development (JSP), and
GWT. I think this creates confusion with some. GWT compiles restricted Java
code to native Javascript. From an implementation perspective, it is not
similar to JSP or JSF at all. When talking about "using Java", one should
distinguish if they are talking about GWT because it is totally different.

I agree with the reasons mentioned for not using GWT, with the exception of
the loading process (this is no longer used in GWT 1.4) and the CSS/HTML
argument. You could code your entire site in HTML/CSS if you wanted to,
wrapping your HTML in HTMLPanels.

That being said, I am not surprised that someone would switch from GWT to RoR.
It really depends on what you need. I think for most applications, GWT is
simply overkill. Sometimes people dont need to utilize RPC's or client side
processing. Rails is so fast and elegant and you can reach desirable results
quickly. And lots of people are simply tired of looking at Java syntax from
their day jobs (I think this partly fuels the Java-hate).

But I would argue that there are times when RoR is not the best choice. The
application I'm working on would not be possible for me to build in RoR
(realistically). It could be, but I would have to write entire RPC and event
listener frameworks to handle the level of complexity required for the
asynchronous components. I need bullet-proof debugging, a native Ajax
environment, low-level server back-end control, and high-level RPC abstraction
right out of the box. We'd like to internationalize this stuff too, and
directly integrate iPhone support (loaded via user-defined properties). It is
for this type of stuff that GWT is my tool of choice. Sometimes complicated
tasks require leveraging tools a bit more complicated to get the job done...

------
geebee
Thanks for posting this! It's the sort of informative topic that probably
won't generate a lot of commentary (as opposed to the the controversial type
that does). But don't interpret quiet as a lack of interest - this is one of
the reasons I scan hacker news.

Actually, I'm looking for a more comprehensive way way to do authentication in
Rails (that doesn't require as much manual intervention as I had to do last
time), and this article definitely helped out.

~~~
edw519
2nd the motion. Thank you!

------
darius
I see you moved away from Java. Have you guys tried JBoss Seam
(<http://www.jboss.com/products/seam>)? If not I strongly suggest you give it
a try. If you love RoR I'm almost sure you'd appreciate JBoss Seam.

~~~
Tichy
I really want to try that, especially since they also support Groovy, if I
remember correctly.

On the other hand, what puts me off is that it seems to require an application
container. I wonder if that would have been the case if it had not been
developed by employees of JBoss... So far I was very happy with Tomcat, and I
am reluctant to move to a full-fledged application server.

~~~
michaelneale
It works in tomcat just fine (I hear). Apparently they have examples that show
it deploying to it. And other ones as well. Yeah I heart the groovy thing as
well. Ruby maybe forthcoming, problem is ruby doesn't have the same sort of
java like annotations that groovy has (and seam expects).

------
DocSavage
Great write-up of your experience! It's particularly interesting that you
moved away from Java/GWT to RoR. Did you find handrolling your own javascript
(+ frameworks) to be just as productive as the Java/GWT approach? (My RoR app
has most of the funky javascript GUI after authorization, so it's not
indexable anyway.)

Some other questions:

\- When do you plan on releasing your git bundle for TextMate? :)

\- Has there been any gotchas when using Joyent's Sun platform?

\- Did you consider using extjs? (<http://extjs.com/tutorial/using-ext-grid-
ruby-rails>)

Thanks again for posting.

~~~
danieltoshea
No gotcha's with Joyent so far. I've been using Solaris for a couple years so
Matt leaves the sys admin stuff to me. We also use webmin which makes things
much much easier.

The git bundle is pretty basic (add, commit, pull, and push) if you are
interested in it shoot me an email and I will send it to you.

------
thamer
Isn't this quite a big risk? Creating an entire application without knowing
the platform requires quite some confidence that it is going to deliver and
live up to the hype. I'm glad it worked out for them, but I know my company
won't start a new project with Rails because we don't have much knowledge
about it. Scaling, especially, seems to be a challenge sometimes (cf Twitter
and the related controversy).

~~~
carpal
1) You will never do anything new if you take that attitude. Anything new
inherently requires risk. If you do nothing new, you fail.

2) Scaling is a problem for Twitter because it has to scale to such an
absolutely massive scale. Saying that you won't choose Rails because Twitter
has scaling problems with it is a stupid argument unless you are reasonably
sure that you're going to be building an application that will get Twitter-
like traffic. No matter what language/framework you choose, if you get the
kind of traffic that Twitter does, _you will have problems._

~~~
cstejerean
well, it's one thing to take risks, it's completely different to write a
production application in a language and framework you barely know. you end up
spending a lot of time looking up things that you already knew how to do in
the other languages you were familiar with. also, what happens if the
application goes down for unknown reasons and you have to troubleshoot the
application at 3am on Sunday? It's sometimes wise to stick to the things you
have mastered and learn new technologies on non-critical applications.

