Hot answers tagged

5 votes
Accepted

A quick ruby crash course

This is a different sort of answer than what you may be hoping for, but I'd really recommend that you deepen your knowledge of Python first. Learn to be pythonic, learn its OOP aspects. Learn its ...
user avatar
  • 34.9k
4 votes
Accepted

What are good projects for metaprogramming?

During lecture, my students and I recreate Javascript objects in Ruby. In Javascript, these two lines are synonymous: config['indent'] = 2; config.indent = 2; ...
user avatar
  • 236
3 votes

A quick ruby crash course

I'd recommend that you look into sinatra or one of the tutorials that are linked from the ruby docs. They also have a specific tutorial in the docs for moving to ruby from another language. The ...
user avatar
  • 4,754
3 votes

What are some examples that could be used when teaching subroutines or methods in the context of OO?

I almost always teach programming by connecting each component of programming with something in real life. For instance, when explaining variables, I ask the students to imagine them as boxes in which ...
user avatar
  • 1,864
3 votes
Accepted

Ruby backend framework choice: Ruby on Rails vs Sinatra

Personally, I'd introduce Sinatra first. Which one of these is going to be easier to explain? Sinatra's "Hello World" example... ...
user avatar
  • 3,485
2 votes

What are good projects for metaprogramming?

The obvious introductory example would be re-implementing Module#attr_reader / Module#attr_writer / ...
user avatar
2 votes

Ruby backend framework choice: Ruby on Rails vs Sinatra

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 ...
user avatar
  • 9,042
2 votes

What are some examples that could be used when teaching subroutines or methods in the context of OO?

Subroutines/methods are a way to reuse code. As is iteration (loops). They are also a way to document what code does. Therefore show how they can be used to reduce the amount of code: to make the ...
user avatar
2 votes

What are some examples that could be used when teaching subroutines or methods in the context of OO?

Perhaps I'm wrong, but your question (and your example) seems to imply that your intention is too "teach them Ruby". For beginners that seems backwards to me. My intention would be to teach them to "...
user avatar
  • 34.9k
1 vote

What are some examples that could be used when teaching subroutines or methods in the context of OO?

Have them write up a straight class and document it. Here are some ideas. Complex Numbers: Create a class that spawns complex numbers and does their arithmetics. Throw exceptions where needed. Big ...
user avatar
  • 2,279
1 vote

What are good projects for metaprogramming?

A documentation system similar to Python's, where documentation isn't stored in the source text, but as dynamic data inside of instance variables of the documented objects themselves. This also ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible