Ask HN: Is Ruby on Rails really worth knowing?
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?
19 comments
[ 2.5 ms ] story [ 51.9 ms ] threadOf 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!
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.)
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.)
However, Rails is a Ruby web framework; Python and Rails do not mix. The Python equivalents would be Django or, I think, Pyramid.
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.
http://en.wikipedia.org/wiki/Query_string
My advice: come in on the Rails - stay for the Ruby.
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.
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 :)
taking the time to learn rails isn't just about learning rails, it is also about keeping your ability to learn sharp.
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.
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.