Answers.Body: <p>I think I can answer this via analogy with Python and a surface-level knowledge of Ruby and Sinatra, having skimmed the docs for the latter. From what I can tell the following holds true (although I'd gladly be corrected if it's too reductive):</p>
  
  <pre><code>Sinatra : Ruby on Rails :: Flask : Django
  </code></pre>
  
  <p>If you want a full framework for Ruby, you go with RoR; if for Python, Django.</p>
  
  <p>I taught my students the basics of Flask this year, and using <a href="http://pythonhow.com/building-a-website-with-python-flask/" rel="nofollow noreferrer">some</a> <a href="https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world" rel="nofollow noreferrer">great</a> <a href="https://exploreflask.com/en/latest/" rel="nofollow noreferrer">tutorials</a>, I found I could get students up and running with a basic Flask page in no time at all. It was a powerful and simple way to combine HTML/CSS with Python without having to set up virtual environments or do any configuration beyond installing the framework.</p>
  
  <p>From an educational/pedagogical perspective, I see two advantages to Sinatra:</p>
  
  <ul>
  <li>It allows students to build something quickly and thus get their hands dirty with more hands-on experience. As a result... </li>
  <li>It scaffolds understanding of frameworks as preparation for later use of Rails.</li>
  </ul>
  
  <p>Scaffolding concepts in programming is essential to avoid that conceptual leap that is a hair too great. The logic of <code>Ruby -&gt; Sinatra -&gt; Rails</code> shows a logical progression of increasing complexity. It also affords those interested and more experienced students an additional challenge. Understand Sinatra? Move on to Rails. The extension for further learning is also an important factor to weigh. Where do you want all students to end up in terms of competence? What about this who want to and/or who can exceed that expectation?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T20:42:14.553Z
Answers.LastActivityDate: 2017-05-27T20:42:14.553Z
Answers.UserDisplayName: Peter
Answers.Body: <p>Personally, I'd introduce <a href="https://github.com/sinatra/sinatra" rel="nofollow noreferrer">Sinatra</a> first.</p>
  
  <p>Which one of these is going to be easier to explain? Sinatra's "Hello World" example...</p>
  
  
  
  <pre><code>require 'sinatra'
  
  get '/' do
    'Hello world!'
  end
  </code></pre>
  
  <p>Or <a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow noreferrer">all the boilerplate that Rails generates</a>...</p>
  
  <pre><code>$ rails new commandsapp
   create
   create  README.md
   create  Rakefile
   create  config.ru
   create  .gitignore
   create  Gemfile
   create  app
   ...
   create  tmp/cache
   ...
      run  bundle install
  </code></pre>
  
  <p>(and that's just from the script that generates everything!)</p>
  
  <p>I would imagine that Rails would feel a little bit overwhelming for a beginner to web development. It brings a lot of baggage with it, like the <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" rel="nofollow noreferrer">MVC pattern</a> and a lot of handy generators that are useful <em>to experienced developers</em>, but hide the logic to a learner.</p>
  
  <p>It seems logical to me to teach using Sinatra first, and then <em>let your students realise</em> what the problems are. They'll be more inclined to go through the process of learning Rails, with all the extra boilerplate involved, if they see <em>why</em> using an opinionated MVC framework is useful.</p>
  
  <p>For trivial backend applications, like you'll probably be developing at first, RoR is overkill, and there are too many concepts that you'd have to teach before actually getting to make anything. I'm a fan of teaching from the basics in this case—showing why each additional layer of libraries and frameworks is needed is far more valuable thank saving some time by skipping Sinatra. And, of course, the motivation to <em>make something</em> can be more easily satisfied by starting with Sinatra, and you can later introduce the 'batteries included' framework of Rails.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T11:56:04.413Z
Answers.LastActivityDate: 2017-05-27T11:56:04.413Z
Answers.UserDisplayName: Aurora0001
Body: <p>In Ruby, the vast majority of usage is in web backends, 99% of the time with a framework called Ruby on Rails. My problem with rails is that it is full of "magic," wherein you type a command, and suddenly 100 LoC are written for you, or where magic methods make forms for you that include both your JS and CSS. There is another framework called Sinatra which is much closer to the reality of what is happening. I really like that it doesn't have very much "magic," but it also isn't used very much in the real world. </p>
  
  <p>Which would be a better choice for introducing students to Ruby backend web development?</p>
  
Tags: <language-choice><curriculum-design><ruby>
Title: Ruby backend framework choice: Ruby on Rails vs Sinatra
ThreadText: # Ruby backend framework choice: Ruby on Rails vs Sinatra
  
  (Asked by: username_0 on 2017-05-27)
  
  In Ruby, the vast majority of usage is in web backends, 99% of the time with a framework called Ruby on Rails. My problem with rails is that it is full of "magic," wherein you type a command, and suddenly 100 LoC are written for you, or where magic methods make forms for you that include both your JS and CSS. There is another framework called Sinatra which is much closer to the reality of what is happening. I really like that it doesn't have very much "magic," but it also isn't used very much in the real world.
  
  Which would be a better choice for introducing students to Ruby backend web development?
  
  **Tags:** language-choice, curriculum-design, ruby
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-05-27. Score: 3 | Accepted answer
  
  Personally, I'd introduce [Sinatra](https://github.com/sinatra/sinatra) first.
  
  Which one of these is going to be easier to explain? Sinatra's "Hello World" example...
  
  ```
  require 'sinatra'
  
  get '/' do
    'Hello world!'
  end
  
  ```
  
  Or [all the boilerplate that Rails generates](http://guides.rubyonrails.org/getting_started.html)...
  
  ```
  $ rails new commandsapp
   create
   create  README.md
   create  Rakefile
   create  config.ru
   create  .gitignore
   create  Gemfile
   create  app
   ...
   create  tmp/cache
   ...
      run  bundle install
  
  ```
  
  (and that's just from the script that generates everything!)
  
  I would imagine that Rails would feel a little bit overwhelming for a beginner to web development. It brings a lot of baggage with it, like the [MVC pattern](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) and a lot of handy generators that are useful *to experienced developers*, but hide the logic to a learner.
  
  It seems logical to me to teach using Sinatra first, and then *let your students realise* what the problems are. They'll be more inclined to go through the process of learning Rails, with all the extra boilerplate involved, if they see *why* using an opinionated MVC framework is useful.
  
  For trivial backend applications, like you'll probably be developing at first, RoR is overkill, and there are too many concepts that you'd have to teach before actually getting to make anything. I'm a fan of teaching from the basics in this case—showing why each additional layer of libraries and frameworks is needed is far more valuable thank saving some time by skipping Sinatra. And, of course, the motivation to *make something* can be more easily satisfied by starting with Sinatra, and you can later introduce the 'batteries included' framework of Rails.
  
  
  ---
  
  ### Answer by username_1 on 2017-05-27. Score: 2
  
  I think I can answer this via analogy with Python and a surface-level knowledge of Ruby and Sinatra, having skimmed the docs for the latter. From what I can tell the following holds true (although I'd gladly be corrected if it's too reductive):
  
  ```
  Sinatra : Ruby on Rails :: Flask : Django
  
  ```
  
  If you want a full framework for Ruby, you go with RoR; if for Python, Django.
  
  I taught my students the basics of Flask this year, and using [some](http://pythonhow.com/building-a-website-with-python-flask/) [great](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world) [tutorials](https://exploreflask.com/en/latest/), I found I could get students up and running with a basic Flask page in no time at all. It was a powerful and simple way to combine HTML/CSS with Python without having to set up virtual environments or do any configuration beyond installing the framework.
  
  From an educational/pedagogical perspective, I see two advantages to Sinatra:
  
  * It allows students to build something quickly and thus get their hands dirty with more hands-on experience. As a result...
  * It scaffolds understanding of frameworks as preparation for later use of Rails.
  
  Scaffolding concepts in programming is essential to avoid that conceptual leap that is a hair too great. The logic of `Ruby -> Sinatra -> Rails` shows a logical progression of increasing complexity. It also affords those interested and more experienced students an additional challenge. Understand Sinatra? Move on to Rails. The extension for further learning is also an important factor to weigh. Where do you want all students to end up in terms of competence? What about this who want to and/or who can exceed that expectation?
  
  
  ---
  
  