Live data from Hacker News

Ask HN: Should I Learn Ruby?

news.ycombinator.com

71–80 of 112 posts

Re: Ask HN: Should I Learn Ruby?

#71

Earlier quoted context omitted.

Sinatra is also based on Ruby yes? How does it differ specifically from Rails?

Yes, Sinatra is a Ruby web framework. Sinatra is more of a "micro-framework" and puts you closer to the http method. Basically, the api mimics http more closely, you literally use get, put, post, and delete methods to define your routes and actions. In Sinatra, you define your routes in the same place where you program your Resource's functionality, so less mapping is required. In Rails, you have a separate controlle…

Say I take the Rails class. What's the learning curve from there to Sinatra? Better / worse than the other way?

Re: Ask HN: Should I Learn Ruby?

#73
post #47

Earlier quoted context omitted.

Ruby -> Python Ruby on Rails -> Django Git -> Mercurial (Hg) RSpec -> Django's built-in testing

Why Mercurial? Most Python projects I've used are on git.

Well, Mercurial is written in Python, so I guess it belongs on the right side lol.

Re: Ask HN: Should I Learn Ruby?

#74
post #46

As someone who has done 4 years of Rails development and has recently switched to Django for new projects, I can tell you it would be worthwhile to learn both. Ruby and Rails are great most of the time, and the Ruby way of doing things is a great learning experience. That said, I threw my hands up after running into multiple libraries duck punching (monkey patching) ActiveSupport into a mangled, conflicting mess one…

"That said, I threw my hands up after running into multiple libraries duck punching (monkey patching) ActiveSupport into a mangled, conflicting mess one too many times. The open classes thing really is harmful, no matter what anyone tells you. It's a feature that, when used with care, can be very powerful...but the problem is in my experience it's not used with care very often in the Rails world."

I don't quite agree with this. Of course I agree that you should use monkey patching with care, but it's the implications I disagree with.

First, you can monkey patch in python too. Python doesn't make this safer, but it is used more in the ruby world. I think the implication that I take issue with is that it's rails fault that some other library you used monkey patched rails. It's the libraries fault, and people should look into libraries before they use them. Just as you should use monkey patching with care, you should use other peoples libraries with care. Peek at the code before using it.

Rails 3 makes it easier to change things without monkey patching so it should occur less frequently going forward.

Re: Ask HN: Should I Learn Ruby?

#75
post #74
post #46

As someone who has done 4 years of Rails development and has recently switched to Django for new projects, I can tell you it would be worthwhile to learn both. Ruby and Rails are great most of the time, and the Ruby way of doing things is a great learning experience. That said, I threw my hands up after running into multiple libraries duck punching (monkey patching) ActiveSupport into a mangled, conflicting mess one…

"That said, I threw my hands up after running into multiple libraries duck punching (monkey patching) ActiveSupport into a mangled, conflicting mess one too many times. The open classes thing really is harmful, no matter what anyone tells you. It's a feature that, when used with care, can be very powerful...but the problem is in my experience it's not used with care very often in the Rails world." I don't quite agree…

I guess the issue is the prevalence with which it occurs in Ruby, as you say. I've been programming professionally for over a decade now, in at least as many languages, and I've only had this problem with ruby.

Still, I enjoy ruby very much, and I haven't seen my last project in it or Rails. I just need reliability and consistency now, and Python seems to offer more of it. I may as you say hit this same problem in Django, but I haven't yet.

Re: Ask HN: Should I Learn Ruby?

#76
post #13

I'd say, learn Python or Ruby, doesn't matter, but try them both for a few days. One will click and the other won't. If you go the Python route, I've got a free book I'm working for beginners that might be too beginner for you: http://learnpythonthehardway.org/ But I reference two other books on that page which actually could be a good start for you. After that, check out the Django book: http://www.djangobook.com/en…

For those that don't know, most probably do... but I would like to point out the irony in Zed's statement. He's most famously known for creating Mongrel [http://en.wikipedia.org/wiki/Mongrel_(web_server)], an open source HTTP server for Ruby commonly used in Rails deployments.

Re: Ask HN: Should I Learn Ruby?

#77

Earlier quoted context omitted.

Yes, Sinatra is a Ruby web framework. Sinatra is more of a "micro-framework" and puts you closer to the http method. Basically, the api mimics http more closely, you literally use get, put, post, and delete methods to define your routes and actions. In Sinatra, you define your routes in the same place where you program your Resource's functionality, so less mapping is required. In Rails, you have a separate controlle…

Also, if you want rapid prototyping, you should look into a document store such as Mongo. Not having to write migrations (as you would with ActiveRecord + Mysql) is huge. Also, your models can be more flexible. You can add keys to your document as needed. With Mysql, you need to have a migration to add the column.

No offense, but this is absolutely bad advice to a newbie programmer. First, mongo_mapper is virtually undocumented, whereas ActiveRecord has oodles of documentation and examples. You'll spend a order of magnitude more time trying to learn to use both MongoDB and mongo_mapper effectively than you will writing a proper set of migrations.

Second, I'm tired of all the NoSQL hype. I've worked on a project with MongoDB and MongoMapper, and the combination caused more problems than it solved. If you want cutting edge and all that comes with that, go with Mongo. Otherwise, if you'd prefer to focus on problems in the domain you're trying to solve and not the technology you're trying to solve it with, go with something relational and tried and true (PostgreSQL, if I were deciding).

Re: Ask HN: Should I Learn Ruby?

#78
One advantage to learning ruby is that the ruby community tends to be more entrepreneurial than other programming communities I have been involved in. Something awesome about the scrappy freelancers and startup folks I have met at the local RUGs.

If yup do decide to learn ruby, I highly recommend get involved in the community. They'll make great technical resources and business connections.

Re: Ask HN: Should I Learn Ruby?

#79

Earlier quoted context omitted.

Yes, Sinatra is a Ruby web framework. Sinatra is more of a "micro-framework" and puts you closer to the http method. Basically, the api mimics http more closely, you literally use get, put, post, and delete methods to define your routes and actions. In Sinatra, you define your routes in the same place where you program your Resource's functionality, so less mapping is required. In Rails, you have a separate controlle…

Say I take the Rails class. What's the learning curve from there to Sinatra? Better / worse than the other way?

The learning curve to Sinatra will be light. Sinatra is pretty easy to learn, especially if you already know Rails.

Re: Ask HN: Should I Learn Ruby?

#80

Earlier quoted context omitted.

Yes, Sinatra is a Ruby web framework. Sinatra is more of a "micro-framework" and puts you closer to the http method. Basically, the api mimics http more closely, you literally use get, put, post, and delete methods to define your routes and actions. In Sinatra, you define your routes in the same place where you program your Resource's functionality, so less mapping is required. In Rails, you have a separate controlle…

Also, if you want rapid prototyping, you should look into a document store such as Mongo. Not having to write migrations (as you would with ActiveRecord + Mysql) is huge. Also, your models can be more flexible. You can add keys to your document as needed. With Mysql, you need to have a migration to add the column.

That's true and all, but Rails and Django were built to run on SQL dbs right out of the box. Getting them to work with MongoDB takes some work, and I don't think it's a diversion that someone just starting learning frameworks should try to deal with.

As for migrations, I don't think he's gonna be dealing with anything too complicated schema-wise. Django South will write your migrations for you. Maybe Rails has something like that? But honestly, I'd recommend using SQLite and just starting a new file whenever he really felt the need to alter the schema.

Post reply on HN