This post originated from an RSS feed registered with Java Buzz
by Matt Raible.
Original Post: RE: Ruby on Rails Koolaid
Feed Title: Raible Designs ~ We Build Web Apps
Feed URL: http://static.raibledesigns.com/500.html
Feed Description: Opinions and tips on how to build web applications using Java. Currently using Hibernate, Struts, XHTML, CSS, Ant, JUnit and XDoclet.
Interestingly enough, ROR creates
default views for your db tables. Cool. But after I thought about it
for a minute, I came to the conclusion that that feature is certainly
close to useless: It's nice to get you up and running, and great for
seductive demos and articles, but you're going to override at least 100% of the views that ROR generates. And therein lies the rub...
...because views in ROR are a mixture of HTML and Ruby scriplets!
We've been there before, of course, in the early days of JSP with HTML
mixed with Java scriptlets. No thanks, I'll pass on that giant step
backwards.
I've thought about this myself. I think David is right, but only to a certain point. Ruby on Rails (and its scriptlet-ridden views) will work until they get HTML designers in their writing Ruby code. Furthermore, when companies start off-shoring their Ruby development, that's when it gets ugly. JSP scriplets were a disaster because you had HTML developers writing Java code, and using if statements that exceeded the 64K block and such. JSP scriplets are hard to maintain when they're used and abused. I've seen a lot of code (especially the off-shored stuff) that has very ugly and unmaintanable scriplet code. However, using scriptlets in JSPs isn't a bad thing - it's only bad if you're coding business logic and/or, using lots of Java code in them, or having JSPs that are scriplet-only pages.
However, I believe Rails is a bit different. Not only does it enforce MVC from the get-go, but you can't use the views stand-alone (can you?). With JSPs and Servlets, you have the opportunity to use JSPs only - which encourages scriptlets. I do wish that Rails' templates used the ${...} syntax that JSP, Velocity and FreeMarker enjoy - the <% %> syntax brings bad bad thoughts of 1000+ line JSPs.
Oh, and one last thing - for David and Rick (the JSF-is-the-best-thing-since-sliced-bread-duo). At least Rails allows HTML in its view templates. JSF developers don't even get to see HTML anymore - poor guys.