How to find and fix errors in your Ruby code.
A colleague recently stated that “If one uses TDD, Test-driven development, there’s no need to fix or debug code”. Even though I respect this view, he did not include a very important group in this, “ruby beginners, ruby starters, learning to coders”. How does one write a test when one doesn’t know how to write code in the first place?
In this article, I will endeavor to provide some leads, advice, and guidelines for all who want to find and fix errors or bugs in the ruby code. This piece is not by any means a complete article on how to find and fix all errors in every ruby code. My goal here is to teach, impart some knowledge and help others.
What is Ruby? In 1995, Yukihiro “Matz” Matsumoto made the first public release of Ruby as a programming language. Ruby is a general-purpose, interpreted (not compiled), object-oriented programming language. Ruby gained popularity and admiration in the programming community because of its ability to achieve a lot with comparatively little code, its simplicity, elegance and English-like expressiveness in its syntax. And when Ruby on Rails framework was created by David Heinemeier Hansson in 2005, Ruby’s popularity spiked.
For starters, we sometimes see “Ruby” capital R and “ruby” small r. What is the difference between the two?
Ruby is the name of the programming language. As in this statement “I will be learning Ruby soon”. ruby small “r” is the interpreter or the computer program that you run on your machine.
All examples or techniques in this article will use Ruby version 2.1.0 and above. Get Ruby installed on your machine. Please follow instructions here https://www.ruby-lang.org/en/downloads/ to download and install Ruby