Chart type Ruby

!Mac OS X-10.15.7!ruby-2.7.1p83

Overview

The textbook for beginners of ruby is too halfway, so I decided to write it myself. This is because it is frustrating that I have created the scheme ruby = TDD + English, but I can't convey it to the students well.

To study programming, say, "Try and error as you would when solving a math problem." But I wonder if they are really taught how to do that trial and error. Instead of copying the answer in its entirety, it is necessary to disassemble the answer and create it in order to understand the operation. I think that the procedure for practicing this was named TDD (Test Driven Development) in Europe and the United States.

In Japan, it is called sutra copying, but it is even more difficult to understand. Therefore, I will introduce how to write beautiful code that works according to the chart formula that has been familiar in Japan for a long time.

Chart-style appearance and content

When I said the chart formula, I was surprised to find a researcher who thought, "I will solve many problems in a staggered manner." The essence of the chart expression is not there,

  1. Simple subject
  2. Detailed solution
  3. Similar titles

is. In line with this basic

  1. puts; Output only, first hello world, right?
  2. variable and method; method, Kent Beck's suggestion
  3. if, case, array, each by leap year; TDD to case
  4. assert \ _equal; gem, colorize inheritance, require, prevention of duplicate execution
  5. recursive Fibonacci; recursion in test
  6. hello class; classization

I will introduce something. The other essence of the chart formula, "appearance", is html, so please give up.

Finishing problem

You should be able to solve the following problems.

-roman numerals; Roman numerals -google recruit; Google's famous recruitment problem

Ruby development peripheral information

Before learning the language specifications of Ruby, familiarize yourself with the idea of linux, which Ruby focuses on. cui, option, pipe, filter and so on. There are some other useful tools for Ruby development (sometimes called ecosystem ... there are discussions), so I will introduce them.

  1. bash + emacs; before hello world
  2. my \ _help; Note with cui, how to use org-mode
  3. bundler; scaffold construction, CoC, gem
  4. rake; automate everything, system
  5. rubular; Regular expression, reading file
  6. thor; Complex CLI, Rubocop

And so on.

Student work

(This is a reflection memo of 2019, improved in 2020 and uses qiita) The problem is how to judge whether the student solved the similar problem independently.

--Leave the red state of tdd --Leave the green state --Exposing refactoring

I hope that will be one solution. Exactly the log state of git. .. .. Hmmm. What is left there. .. ..

making document

--Try to create the document yourself. ――It is a method to display the code you wrote. ――In the same way as finishing a thesis, you will learn the code through the work of writing a document. --Unlike platex, html out can be done in any environment, so use it. => Change to qiita (20f)


Recommended Posts

Chart type Ruby
Chart type ruby-appendix-III (bundler)
Chart type ruby-I (puts)
Chart type ruby-appendix-IV (rake)
Chart type ruby-appendix-V (rubular)
Chart type 2nd summary
Variable type in ruby
Chart type ruby-appendix-I (bash + emacs)
Easily try Ruby 3.0.0 type checking (rbs)
Is there no type in Ruby?
Ruby learning 4
[Ruby] Array
Ruby learning 5
Ruby basics
Ruby Review 2
Ruby addition
Refactoring Ruby
Pass type
Ruby learning 3
Ruby setting 2
Ruby problem ⑦
Ruby learning 2
[Ruby] Block
Refactoring Ruby
ruby calculator
Ruby learning 6
Directory type
Ruby settings 1
Refactoring Ruby
Ruby basics
Ruby memo
Ruby learning 1
Ruby Review 1
[Ruby] Module
Human type