News for hackers. Stuff that matters.

Ask HN: Should I or Why should I bother continuing with rails

Over the past 3 weeks I've been trying to learn rails. I've been programming in PHP for about 4 years, and decided to expand my horizons and use the language everybody is talking about.

The things I like about RoR is that due to the structure and expectations of rails, I suspect it is much quicker to get new people up to speed on a project because theoretically, the structure is already laid out.

I also in theory like the way it handles migrations, though I haven't actually used it in a production environment yet.

The things I'm HATING is that every little bit of code I write doesn't work!

I'm moving like molasses here, and have very little to show for nearly 3 weeks of messing with this language.

As you can see from my stackoverflow account http://stackoverflow.com/users/48067/pedalpete, if you care to look, I'm spending hours doing minor little things like making a link to delete a database entry and it just doesn't work!

Has anybody been in the same situation? I'm following guides, watching the railscasts, etc. etc. but I'm absolutely not getting it and extremely frustrated.

Maybe I just don't remember being this frustrated with PHP, but I seem to recall with PHP i was getting into some much deeper stuff when I was still learning and I don't remember it being nearly this painful.

Has anybody else had the same experience?

Is there some magic bullet that is all of a sudden going to make this better?

I can't believe that all the hype around RoR is really applicable to everybody but me, so there must be something I'm missing.

( 12 comments | 3 points | on HN )
Re:Ask HN: Should I or Why should I bother continuing with r... by devmonk on Tuesday September 21, 2010 @09:28PM (#1714840)
Instead of trying to do what you want to do, even if it is simple and you know what you want to do should be easily doable, try some tutorials.

Note that if you are using Rails 3, most of the tutorials out there are for Rails 2. This is going to be a rough next year and a half or so.

For Rails 3, check this out if you haven't already. Personally I'm not into watching videos of someone else coding, but maybe you are: http://railscasts.com/ transcriptions here: http://asciicasts.com/

Here comes the frustrating part. Unlike PhP, Java, etc. where just looking up stuff online is enough, unless you participate in the various local Ruby get-togethers or have some others nearby that do, you're likely to find yourself in the dark more than you're used to being. I'm somewhat of an introvert, and have a family where I can't be going to these things nor do I want to, but not going to the meetups definitely hurts it seems. Maybe I've bought into the hype too much about how much the meetups help though, and I've heard from someone that some meetups are more hype than help, so if you don't like one group, try another.

Basically, here are the pain points I can think of:

If you relied on it in the past, lack of static typing hurts in the beginning, but not so much after a year or so with the exception of lack of good method/etc. completion due to the dynamic nature of Ruby.

Having wierd bugs because the gem/plugin you are using is incompatible with the version of Rails, etc. is no fun. Read the docs associated with the gem/plugin. Submit a ticket/contact the developer(s) some other way to find out what they use. This doesn't bite as much as you'd think.

Trying to track down what in the heck is going on in Rails, Active Record, etc. can be a pain when something isn't working. I've not gotten good enough to feel totally comfortable with this, but I know people after working several years with it are more at home with this.

Upgrading Rails can suck.

You'll read suggestions that say if you don't write test first, you'll not be able to handle bugs/issues that well. That is probably true, however the team I'm on doesn't pay attention to testing as much as they should, and we get by mostly ok (some tough issues here and there).

Overall, Rails is ok, and Ruby is pretty cool. Also check out Sinatra, etc. Maybe you don't need Rails for what you are doing.

Re:Ask HN: Should I or Why should I bother continuing with r... by pedalpete on Wednesday September 22, 2010 @12:33PM (#1716680)
I did a 'build a twitter clone in rails' tutorial rote, but I find I learn much better if I put my own spin on the tutorials as it forces you to look deeper and understand what you're doing rather than just following along and copying code.

I would suggest nobody 'needs' rails, i can get along very well with php, but I thought I'd see what all the hype was about. I suspect I'll go back to my php land. Unfortunately feeling a bit defeated.

Re:Ask HN: Should I or Why should I bother continuing with r... by devmonk on Wednesday September 22, 2010 @01:48PM (#1716920)
Some thoughts:

PhP is for general-purpose web application development, but somewhat targeted at building "higher traffic dynamic webpages", although it is much more than that. It's widely used, and it's been around a good while. It isn't going away, and I'm not trying to convince you to stop using it.

Ruby by itself is a fascinating language that developers should get familiar with. Why? IMO, primarily because of this: http://scotland-on-rails.s3.amazonaws.com/2A04_DaveThomas-SO...

But Ruby on its own is a bit like Java, Perl, etc. It isn't really web-oriented. Rails however is a framework that uses Ruby and bundles code that makes working with/storing data, web forms, etc. easier. On the surface, unlike PhP, Rails seems to have a mindset of its own, attempting to get you to use conventions that try to put webapps more into a box, so you can develop faster once you learn the box, whereas PhP alone is more wide-open. However, almost immediately you learn that box is almost entirely imagined. Ruby is even more wide-open than PhP, so Rails is also.

It might be hard to get a picture of the sheer amount of functionality available for Ruby on (and off) Rails via http://rubygems.org/ and http://github.com/ but trust me- there is a lot! The same can be said for PhP as well, but it isn't packaged up quite the same.

RoR tries (notice I said tries) to make things simple. So developers get pulled in and make rookie mistakes because the details are glossed over that aren't glossed over in Java, etc. as much. I've seen and been told of PhP developed by those that didn't know what they were doing that is the same way, though.

I agree that nobody "needs" Rails, but spend some more time with it, and you'll find you'll use it more than PhP for some applications.

Re:Ask HN: Should I or Why should I bother continuing with r... by thinkalone on Tuesday September 21, 2010 @09:12PM (#1714811)
Are you learning Ruby at the same time, or do you have prior experience with the language aside from RoR? Ruby "feels" quite different from PHP, so if you are tackling it in addition to learning Rails, possibly it would be better to stick to Ruby tutorials and scripts that run locally, then stepping up to learning Rails.

Also, if it's Rails that's giving you trouble, have you considered starting with a smaller framework like Camping or Sinatra? That feeling of none of your code working can be frustrating, but maybe it's because you missed some of the beginning steps with Ruby and it's making things more difficult than they should be!

Re:Ask HN: Should I or Why should I bother continuing with r... by LeBlanc on Tuesday September 21, 2010 @09:19PM (#1714817)
I also recommend learning Ruby before Rails. I tried it the other way and was often very confused as to why something would work or not because Ruby and Rails both do a lot of things that seem like magic to a new user.

Plus, hacking in Ruby can be a lot of fun. There are a lot of really neat tricks you can use to do really cool things.

Re:Ask HN: Should I or Why should I bother continuing with r... by pedalpete on Wednesday September 22, 2010 @10:28PM (#1718331)
When I told a friend I was giving up on Rails and explained why, he also recommended learning Ruby alone. I didn't understand why until he explained " the caller doesn't have to use curly braces to signify a hash if the hash is the last argument in the call. For methods that only take a single hash as an argument, this is pretty easy to understand. "

This resolved a huge issue I was having with my Ruby, but I find this to be a really poor way to write a language. Maybe it will just take more getting used to.

We hear people say that English is so difficult to learn because of these 'rules and exceptions', so maybe I just need to get that mentality and realize that just because something worked in one instance, it won't in another.

I will spend more time focusing on learning Ruby. i was always thinking the problems I was having was due to rails.

Re:Ask HN: Should I or Why should I bother continuing with r... by lfborjas on Tuesday September 21, 2010 @09:09PM (#1714804)
I'm in your exact same situation, man; I've developed in php , python (with django and webapp) and little webapps in ruby with sinatra. I begun with rails 3 (and rails in general) two weeks ago, and am feelin' the progress rather slow. I think some of it is due to the usual learning curve and the kinda hard to find documentation and broken plugins. I'm starting to get it, but I'm also being tempted by the fact that I read the documentation for padrino (www.padrinorb.com) last night and felt that I understood more than what I have gotten from rails 3 in two weeks. So, you're not alone, and, if it weren't for the fact that padrino is really new and doesn't have as large a community as rails, I would have made the switch without hesitation right away. Still considering it, though.
Re:Ask HN: Should I or Why should I bother continuing with r... by pedalpete on Tuesday September 21, 2010 @10:17PM (#1714962)
I hadn't heard of padrino, and hadn't looked closely at Sinatra which i thought was a ruby plug-in rather than a different Ruby web framework.

Originally I was working with a whole bunch of Gems to learn mongo and do some more interesting stuff, but with all the gem issues, I decided to just stick to the basics and am building what should be a fairly simple app.

Re:Ask HN: Should I or Why should I bother continuing with r... by lfborjas on Saturday September 25, 2010 @01:13AM (#1726369)
oh, well, that's swell; I finally sticked to rails (finally got the knack of it) and am using mongoid for mongodb interaction, if you're interested, here's a fine example of mongodb in a simple working rails 3 app: http://github.com/fortuity/rails3-mongoid-devise
Re:Ask HN: Should I or Why should I bother continuing with r... by sublemonic on Tuesday September 21, 2010 @09:45PM (#1714870)
I'm also new to web development (I have no where near 4 years of experience). Do you understand object oriented programming enough to explain it to a programming newbie? If not, you need to take a class. No amount of Railscasts/Peepcode vids/Rails books will teach you OOP, and yet Ruby and Rails require a working knowledge of it. I know PHP is an OOP lang, but you may not have used it that way.
Re:Ask HN: Should I or Why should I bother continuing with r... by jasonshen on Tuesday September 21, 2010 @08:38PM (#1714718)
What version of Rails and Ruby are you running? A lot of tutorials, guides, fixes, etc are based on older versions (not 3.0 and 1.9.2). I've been trying to do some stuff with Rails (granted without 4 years of PHP) and it's been slow going as well. Everything is just a little less documented and a bunch plugins, bug fixes, etc just aren't up-to-date yet.
Re:Ask HN: Should I or Why should I bother continuing with r... by pedalpete on Tuesday September 21, 2010 @08:49PM (#1714750)
I am running 3.0 and 1.9.2. I realize that I am ahead of the curve on much of the tutorials, but should that really be causing this kind of complete breakdown.

There is backward compatibility, and I am learning the rails3 way as much as possible, looking to the rails3 documentation rather than the older stuff.