Rails or Sinatra? What is good to start training PHP programmer?

I have been working with PHP for too long and missed it. I also want to learn a new language.

I use Ruby and love this. I have to decide between Rails and Sinatra, and which one would you recommend? Is it true that Sinatra cannot be used to create complex applications, and this is only for simple applications?

+6
ruby ruby-on-rails sinatra
source share
7 answers

Go with Rails, it has a lot more documentation / books than Sinatra. It is also more mainstream, and many IDEs handle the rails in a special way to a first-class citizen, so it's a good idea to start with it.

Although you can write any application for either of the two, Sinatra is designed to be more simplified, so Sinatra application with complex applications may require additional effort.

+8
source share

If you're a “very newbie” with Ruby, you might want to go over to Sinatra first: it's very small, well-documented, and easy to learn. Then for more complex web applications, you should try Ruby On Rails.

http://railsmagazine.com/issues/5 is a free introductory article in PDF that I wrote for Rails magazine.

+16
source share

Oh please, please don't start with the rails. It’s like joining a battle for the first time against a tank division. It’s better to start with some troubled natives and work. It’s good that it’s not a big analogy, but the rails are too much time for training. You can quickly pick up a Sinatra and then go on the rails - this is a smart step forward. This is the most useful. With rails in tons of tangled things. They add a lot of material to the language, etc. If you do not know Ruby and the base classes, then just do Sinatra. It is fast, easy and you do not need to study migrations, rakes, etc.

+8
source share

you must know both because they are made for different purposes. sinatra is a microstructure for small applications. rails is a full-blown mvc framework with many helpers for almost everything.

I would say that Sinatra is easier to recognize if you know a ruby, because it is very small and follows common ruby ​​idioms. but it’s not much harder to study the rails. The documentation is excellent and you will find many tutorials and manuals online.

as I said, it's really good to know both so that you can choose the right tool for the job.

+4
source share

First go with Sinatra. It is very simple and easy to understand, plus it covers the basic principles of Rails (MVC architecture, etc.). Then you can upgrade to Rails. In addition, thanks to your knowledge of Sinatra, you can write Sinatra applications in Rails metal, which will simplify the creation of the API.

+4
source share

Either Rails or Sinatra is a great choice to learn.

I started working on a project in Rails, where I literally knew nothing about web development or Ruby October 2009 (my co-founder helped me break some of the initial hurdles and brought me to RTFM). I ran into some problems, but could easily code business logic. I recently started porting a project to the application engine and used Sinatra as the basis, and it was an incredible learning process. Mostly for learning all the things that Rails did automatically. It was also useful for simplifying the definition of class members and the method of their persistence (migration, unfortunately, is lavash, although background processes are used to change the format).

You might want to consider where you will deploy.

Since I am primarily interested in a direct application with a low server cost, both Heroku and Google App Engine work well. Rails / ActiveRecord / Sqlite and Heroku work swell Sinatra / Datamapper / Datastore in the Google App engine thread well.

Rails also works successfully in the application engine, so this choice is also open. IMO Heroku is a little easier to deploy.

+1
source share

You might want to take a look at Ramaza in addition to or instead of Sinatra. It seems that Ramaze sits between Ruby on Rails and Sinatra in terms of features and convenience.

0
source share

All Articles