20050221 Monday February 21, 2005

RE: Ruby on Rails Koolaid David Geary on Ruby on Rails:

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. ;-) Posted in Java at Feb 21 2005, 09:55:25 AM MST 4 Comments

Comments:

JSF does allow a fair bit of HTML. You should see the ASP.NET guys. Poor souls :-)

Posted by Eddy Young on February 21, 2005 at 02:59 PM MST #

If you use something like Oracle's ADF Faces package, true HTML is almost totally removed. Everything is a JSF tag. However, ADF Faces makes JSF quite easy to work with and makes quite stylish sites. <p/><p/> As Matt alluded to... while you _can_ stuff a whole bunch of ruby logic into an rhtml view, you typically don't do so. There are a lot of sample projects available on the rails site, and browsing their code shows this to not be a problem.

Posted by 204.58.233.6 on February 22, 2005 at 07:50 AM MST #

[Trackback] There is yet another blog discussion about Ruby on Rails vs. Java web frameworks. I think you find this type of discussion all over with the generic version being: Technology X is simpler than Y so it either: Is too...

Posted by techno.blog("Dion") on February 22, 2005 at 07:53 AM MST #

RE: "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." First, it is an honor to be lumped together with someone as talented as David. Second, I agree with you and would love to see JSF have some component level templating ala Tapestry. I think the JSF guys would do well to study Tapestry, and borrow some of the ideas from that project. I like working with JSF, but much prefer sliced-bread. I've been known to work with SpringMVC, and Struts as well. I don't dislike Tapestry either. I like JSF, but would love to get hired on a Trails or even Rails project. I consider myself open-minded.

Posted by Rick Hightower on March 01, 2005 at 05:56 PM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is the Lead UI Architect at LinkedIn. The opinions on this site are mine, not my employers.
« November 2008
SunMonTueWedThuFriSat
      
1
2
3
6
7
8
9
10
11
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
      
Today

Recent Entries

Tag Cloud