What is the difference between return and just putting a variable such as the following:
return
def write_code(number_of_errors)
Unnecesarity of return at the last line in function is just syntaxic sugar of Ruby. In most procedural languages you need to write return in each (non-void in C++) function.