3 ms·
Java Kicks Ruby on Rails in the Butt
- gunmetal 16y agoThis is supposed to be funny right?
- gte910h 16y agoFeels like the guy doesn't like RoR, but doesn't really convince me of anything beyond that. The "... I prefer active code generation [11], or even better, no code generation at all." quote then using Eclipse or what have you to spit out a bunch of boilerplate code is a bit rich. Also, he's talking about doing java a non-javaonic way. I present to you Sean Kelly's (of JPL) reason why that doesn't work: http://www.archive.org/details/SeanKellyRecoveryfromAddiction http://www.archive.org/details/SeanKellyRecoveryfromAddictio... (at 6:25 or so)
- jtchang 16y ago@Id @GeneratedValue @Hidden private Integer id; Am I the only one cringing? I haven't seen Java code in a while but that is a lot of decorators (or annotations). I don't even remember what they are called anymore.
- marketer 16y agoThis article is old (from 2009). The guy needs to read the first chapter in the Ruby on Rails tutorial where it goes over generating models and creating database migrations. There's a very nice api for it.
- hammerdr 16y ago[2009] You're doing it wrong. > Ruby is a dynamically typed [7] language, as Smalltalk [8]. I prefer statically typed [9] languages. Without getting into a religious battle, I believe that Ruby is a better (web) language than Java. He later concedes the point that "productivity in Java world is a cultural problem." Culture, for better or worse, is part of a language. > Scaffolding is passive code generation, as IDE wizards or AppFuse [10]. I prefer active code generation [11], or even better, no code generation at all. Scaffolding is a tutorial only experience. There were definitely some awkwardness in how scaffolding was presented but it is definitely not the Rails Way anymore. (edit: And never really was.) > Relational database centric: the code generators and ActiveRecord promote think first in tables after in classes. I prefer a more pure OO, as Hibernate [12], JPA [4] or even ODBMS [13]. At the time, I probably would have agreed. ActiveRecord in 2.3 was a bit archaic and the whole database layer got much improved in 3. I use Mongoid. > MVC [14]: I'm looking for something newer and better that an old MVC framework. Why? I understand his point. He is arguing that the language doesn't much matter and that the 10x productivity is a myth of Rails. While I think the productivity is a bit exaggerated, you really need to get into long projects on both before making a judgement call. Java Spring applications with nHibernate are usually encumbered by Java 'best practices' and not the language. Culture is everything.
- danielharan 16y ago"OpenXava, Trails, NakedObjects, RomaFramework and JMatter" Fuck. Me. Now. Trails? That barely working clone of Rails that never really took off? And hey, what happened to EJBs, Struts and Tapestry? Java is 10X more productive once you spent a decade selecting and then mastering your over-engineered toolkit, and then jettisoning it to learn Trails. That I could pick up a RoR book and develop a full application was such a relief, coming from a time in Java development where you needed massive amounts of knowledge just to get an n-tier "Hello World".
- n72 16y agoAnd now thankfully we have the Play framework for java/scala.
- DjDarkman 16y ago> You modify the new and update method adding the line: > @recipe.date = Time.now > The equivalent in OX is adding the @DefaultValueCalculator annotation in model: > @DefaultValueCalculator(CurrentDateCalculator.class) > private Date date; > You obtain the same effect in a more declarative way. That is more like a more verbose way. I am not a Ruby guy, but I would prefer the first syntax.
- foljs 16y agoMore verbose? Both are only one line statements. The only way it's more "verbose" is because the class name is bigger. You can use a one letter classname, if that's your problem.
- umjames 16y agoSo he's comparing a RoR web application with a Java portlet? Notice the portlet screen shots don't show the rest of the browser window like the Rails ones. That's because you'd see the rest of the portal chrome and the god-awful unfriendly URL that all portals can't escape. Portlets weren't meant to hold full web applications, but that's how every IT department tries to use it. Actual web applications let you have control over the URL structure and easily link to other pages. In portlets, to maintain cross-portal compatibilty, the portlet must be isolated from the rest of the portal. That means you can't link to other pages unless you use a specific portal's proprietary API or hard-code the links. He also tends to gloss over the setup of the portal and application servers needed to run the portlet even for development purposes. I assure you it's more than 'rails server' or 'rails script/server'. I also noticed how he has to depend on Eclipse to make it look like all he has to do to see changes is use a simple keyboard shortcut. Eclipse is doing the work of compiling the code, making a proper .war file and moving that file to right place so his application server will re-deploy it. Not to mention that depending on the change, you have to restart the application server also. Rails doesn't require 3rd-party tool support to make things seem easier than they are.