

Ask HN: Is Ruby on Rails really worth knowing? - wesleyzhao

It seems that every where I am still seeing php GET variables in URLs (including on HN) and there is just so much support out there on the web for PHP. Big companies like Facebook and Wordpress still use it. Is Ruby on Rails really that valuable to learn?
======
cheald
GET variables aren't unique to PHP. They're simply a means of passing data
through on any HTTP GET request. HN itself runs on
[Arc](<http://arclanguage.org/>).

To answer the question, Rails is certainly worth learning if you're interested
in web applications development. It has, for better or worse, set the
benchmark for interpreted MVC web frameworks, and a lot of the design
decisions being made in other frameworks are heavily influenced by it.

(Also, it's fun.)

~~~
wesleyzhao
Thanks for the link to Arc! I've heard it's fun, but for a newbie is it a
concern that there is not as much support? I've heard there is maybe less
quantity of support but the support online has more quality than php because
of the quality of users.

~~~
cheald
I don't know much about Arc, but my gut feeling is that it is not likely to be
newbie-friendly, between the combination of it being somewhat esoteric and,
you know, a dialect of _lisp_ , which isn't exactly known for being all that
friendly to the new programmer. :)

~~~
wesleyzhao
I was actually referring to RoR in regards to support concerns but I
appreciate the arc response :). Still helpful.

~~~
cheald
Ah, sorry. RoR has a very vibrant and active community, and I don't think
you'll have any problem finding help with it if you choose to go that route.

------
anyangels
It's called a query string...

<http://en.wikipedia.org/wiki/Query_string>

My advice: come in on the Rails - stay for the Ruby.

------
chr15
There is always a big debate surrounding what language to learn, and I don't
think you'll get a solid answer from us. You'll have people arguing about
which language is better. PHP, Python, and Ruby frameworks seem to be most
popular here on HN. If you're new, my advice would be to experiment with
different languages/frameworks but eventually have a "go to" one. Choosing a
framework that you enjoy is a discovery process. Along the way you'll learn
about language design.

By the way, GET requests are part of the HTTP protocol. Every web-based
framework should support them, not just PHP-based ones. HN is written in Arc,
a dialect of Lisp created by Paul Graham.

I personally use Python/Django :)

------
rst
Facebook and Wordpress are using PHP, but they've put significant effort into
overcoming its pitfalls.

You can do anything in PHP that you could do in a more modern framework
(Rails, Pyramid, Django or whatever), but some things will be more effort ---
in particular, keeping the codebase organized and well-tested as an app gets
larger.

(Also, FWIW, Facebook's codebase isn't all PHP, and Facebook alumni don't
always stick with PHP for their next ventures. For instance, Quora's using
Python on the server side; apparently its founders see some value in the
switch.)

~~~
wesleyzhao
Python is very fun and agile, however I was always under the impression it was
also not meant for big projects as it is strongly not typed. Do you think
Python is a great substitute or compliment to rails? What's your code of
choice?

~~~
sho_hn
Python actually is strongly typed: Everything does have a type, and aside from
within numerics (integers upconvert to floats), Python generally won't
automatically convert between them. Mixing objects of different types in
operations that would otherwise be ambiguous hence throws an error: You can't
use a string and a numeric as the operands of an addition without explicitly
converting one of them first, for example.

However, variables in Python aren't names assigned to storage areas for data
of a particular type, but store references to objects, and can be freely
reassigned to objects of any type at any time, i.e. there's no type constraint
on them. Similarly, Python's built-in collection working horses (lists,
dictionaries, tuples, sets) store references to objects of any type as well,
including allowing mixing of the types of referenced objects in a single
collection.

So while on one hand it won't allow you to shoot yourself in the foot with
type mixing to a degree that e.g. PHP does, it also won't allow you to place
much in the way of specific type constraints on common constructs. Technically
you can check an object's specific type explicitly, but that's a lot of manual
work and frowned upon since it undermines polymorphism, i.e. having the same
code work on as many different object types as possible as long as they
implement the interfaces the code wants to use. Some people feel this makes
large bodies of code harder to maintain than in a language that places
specific type constraints on variables, collections and other constructs.

------
bricestacey
Rails has GET variables, but the "rails way" is "restful routes" whenever
possible. So something like /posts/12 will automatically pass 12 as a specific
GET variable e.g. params[:id]. Or /posts/12/comments/4 might pass the
parameters :id (12) and :comment_id (4).

This happens all the time for people using PHP too, however it's usually
accomplished via mod_rewrite. For example, Drupal's pretty URLs simply rewrite
/posts/12/comments/4 to /index.php?q=posts/12/comments/4.

------
JesseDearing
When I first learned Rails I kinda messed around with it and wrote a quick
demo app, but really wasn't that impressed with it. Coming from a C#
background and ASP.NET MVC had just come out I didn't see much value in
learning a new MVC framework.

However, when I started to need a language that I could use to write code that
would let me easily integrate with different services and APIs I was finding
that C# was cutting it for me. Not so much C# than just the .NET community. I
found that the Open Source community is Ruby's greatest asset.

There are so many gems to be used in Ruby/Rails that I found that I seldom
have to write anything from scratch. There is always a gem I can use to help
me get a job done.

The second strongest asset of Ruby is the language itself. I found it to be a
wonderful language to write in. Since learning Ruby, I haven't cared to write
another line of C# again.

Is it worth learning? I say emphatically, "yes" but I would implore you to try
it for yourself. Also checkout Github/Rubygems.org to see if there is a gem
out there to try.

------
clojurerocks
It really depends what your looking to do. I use Rails and php depending on
the project. I would say actually its best to focus on frameworks and Rails is
probably one of the better ones out there these days. Django is also
interesting. Php frameworks are going through alot of changes right now with
no clear winner. So youll have to spend extra time even trying to figure out
which one to use whereas with Rails its pretty much the dominant one so all
the support in the community goes to it.

There are only a few ways you can pass data from one web page to another. Get
and Post. Get sends it in the url whereas Post sends it in sort of a hidden
way. In the old days post was preferred for more sensitive data so the user
wouldnt see things in the url. Also post was and is used to keep the urls
cleaner. However with the advent of web services the uses of these have
changed somewhat.

------
nishantpant
I had my doubts about Ruby too, but we built the entire backend of our iPhone
app (<http://loqly.me>) on ROR and our website is going to be entirely on ROR
too. The amount of time it saves you as compared to any other language is
nothing short of mind blowing. Of course I am just sharing my 2 cents since
you asked. Others could have a different experience. But we started out with
php and 2 months down the line changed over to ROR and boy were we glad we
switched!

------
runjake
Yes. But make sure you start with Rails 3 and Ruby 1.9. They are vastly
improved over Rails 2 & Ruby 1.8 IMHO.

------
noodle
the most important skills you can have, imo, is the ability to learn new
things as soon as possible, to be come competent quickly.

taking the time to learn rails isn't just about learning rails, it is also
about keeping your ability to learn sharp.

~~~
wesleyzhao
I believe it! Since I have already picked up Python, I guess rails is going to
be my next learning experience this Spring Break...

