Live data from Hacker News

Ask HN: Is Ruby on Rails really worth knowing?

news.ycombinator.com

11–20 of 20 posts

Re: Ask HN: Is Ruby on Rails really worth knowing?

#12
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!

Re: Ask HN: Is Ruby on Rails really worth knowing?

#13
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.

Re: Ask HN: Is Ruby on Rails really worth knowing?

#14
post #5

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 s…

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?

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.

Re: Ask HN: Is Ruby on Rails really worth knowing?

#15
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 :)

Re: Ask HN: Is Ruby on Rails really worth knowing?

#17
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.

Re: Ask HN: Is Ruby on Rails really worth knowing?

#18
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.

Re: Ask HN: Is Ruby on Rails really worth knowing?

#19
post #16

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.

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