News for hackers. Stuff that matters.
Re:Zero to Riding the Rails in Four Months by Tichy on Monday October 15, 2007 @04:42PM (#68208)
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...

Re:Zero to Riding the Rails in Four Months by ardit33 on Monday October 15, 2007 @05:49PM (#68243)
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.

Re:Zero to Riding the Rails in Four Months by davidw on Monday October 15, 2007 @06:51PM (#68276)
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.

Re:Zero to Riding the Rails in Four Months by hello_moto on Tuesday October 16, 2007 @02:14AM (#68426)
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.

Re:Zero to Riding the Rails in Four Months by davidw on Tuesday October 16, 2007 @03:44AM (#68440)
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.

Re:Zero to Riding the Rails in Four Months by Tichy on Monday October 15, 2007 @06:31PM (#68265)
Why don't you like Hibernate? It has never let me down so far, and I am positive that it is way superior to ActiveRecords. At least it also handles lots of special cases that are not implemented in AR. I also like the HSQL syntax.
Re:Zero to Riding the Rails in Four Months by ardit33 on Monday October 15, 2007 @06:51PM (#68277)
It is very bloated. Typical Java style. Too much XML (or anotattions), lots of "magic" happening, without you knowing what's going on. For complicated joins, you are much better off with just SQL (maybe using some utilities like Jakarta's DButil).

Hibernate is just another complexity with a steep curve, and it's propertary stuff to learn (HQL ?).

If you must do a ORM, I like Apache's Cayenne. It comes with a very nice utility, which creates everything for you. Much simpler than Hibernate.

Overrall I'd rather not use java. Python seems a much better fit for web development, thou it's most popular framework, Django, suffers a lot of the same stuff as Rails.

And Ruby is an ugly language. Too perl-ish.

Re:Zero to Riding the Rails in Four Months by Tichy on Monday October 15, 2007 @07:18PM (#68286)
No way you would create a join with pure SQL, filling all the objects fields by hand is just too much pain. I found HQL very intuitive to use, it is almost exactly like SQL, only with a few shortcuts. The learning curve was not so steep either.

Hibernate does one thing, and does it well. With the annotations, it has improved even more. What parts of it do you consider magic? Magic is not necessarily a bad thing - I like the magic of higher level programming languages that shield me from the gory details of assembly language. I just don't like it if code is not readable anymore without knowing the magic.

I will look into Cayenne on occasion. Hibernate is the industry standard now, though, and for a good reason in my opinon.

I would like to move to a more dynamic language, though...

Maybe using GORMS (the ORM from Grails, based on Hibernate) standalone in a Java project would be nice.

Re:Zero to Riding the Rails in Four Months by michaelneale on Monday October 15, 2007 @09:31PM (#68329)
>And Ruby is an ugly language. Too perl-ish.

Definately a taste thing, but I would agree (having done a bit of both over the last year). Ruby OO is nice, but then OO is often the cause of problems for me (python makes quasi functional styles easy).

People don't really use XML with hibernate (and haven't for some years from what I see). Hibernate does try to cater for every corner case though (perhaps the cause of the "bloat"). But its the 80/20 rule again - most people only want 20% of the features, the problem is that every one wants a different 20% (hence you get subjective bloat).

Re:Zero to Riding the Rails in Four Months by jamesbritt on Tuesday October 16, 2007 @06:24PM (#68778)
> 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".

Ruby is PHP 2.0? Have you spent any time with Ruby, or have you only looked at Rails, one of several Ruby Web frameworks?

I suspect few ex-PHPers are doing straight-up Ruby coding.

Re:Zero to Riding the Rails in Four Months by adrianwaj on Tuesday October 16, 2007 @03:40AM (#68439)
Del.icio.us are rewriting in PHP with the Symfony framework:

http://www.symfony-project.com/blog/2007/10/02/delicious-pre...

Why would they choose that??

Re:Zero to Riding the Rails in Four Months by jamongkad on Tuesday October 16, 2007 @05:04AM (#68446)
I think the crap producing PHP crowd the peeps are referring to are those developers who use plain jane php with their webpages (logic mixed with presentation). Believe me I was one of those guys and I hated myself for it. Now there are real serious PHP frameworks out there that do a very nice job of MVC (obviously due to the popularity of RoR). Symfony, Code Igniter, CakePHP(to some extent) just to name a few. So don't worry there is still hope for PHP yet.
Re:Zero to Riding the Rails in Four Months by moorage on Monday October 15, 2007 @04:57PM (#68218)
Well, give it a try. Again - a tool is just a tool and it has to fit the hand of the person using it. If Java is your thing, Java is your thing... but there is a lot to love in Rails.

Give it a shot for your own edification - a lot of making a rails app is the command line: install ... The lightweight plugins are just beautiful, and they would only be possible with Ruby or a language like it. It really makes your code a joy to create, maintain, and update.

Re:Zero to Riding the Rails in Four Months by Tichy on Monday October 15, 2007 @05:46PM (#68241)
I am determined to write at least one Rails application. Obviously there must be something to it, otherwise it would not have so many fans. I just wrote that rant because I was kind of frustrated with Rails - sometimes aesthetic issues are hampering my productivity. I would be curious how many excellent Java developers have switched to Rails happily. Your example doesn't convince me very much, because of the GWT ingredient. I haven't used it, but the concept sounds very weird (compile Java to JavaScript), so I am not surprised that you gave up on it.