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…
Ask HN: Should I Learn Ruby?
71–80 of 112 posts
Re: Ask HN: Should I Learn Ruby?
#72Re: Ask HN: Should I Learn Ruby?
#73Re: Ask HN: Should I Learn Ruby?
#74As 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…
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?
#75As 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…
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?
#76I'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…
Re: Ask HN: Should I Learn Ruby?
#77Earlier 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.
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?
#78If 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?
#79Earlier 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?
Re: Ask HN: Should I Learn Ruby?
#80Earlier 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.
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.