1.4 Summary

You now understand the core foundations of computer science, namely the use of algorithms to solve real-world problems. Ruby, as used throughout the remainder of the book, is a powerful, yet relatively easy to understand, programming language that can be used to implement these algorithms. It is, however, critical to remember that independent of the programming language used, without a good algorithm, your solution will be ineffective.

1.4.1 Key Concepts

  • The essence of computer science is problem solving. Computer science involves using the computer as a tool to model or solve various problems, from storing names in a database to finding efficient directions to a friend’s house.

  • When programming, it is important to understand that the computer is never wrong. It is merely following the directions you have given it.

  • The following are basic steps for solving a computer science problem:

    Step 1: Understand the problem.
    Step 2: Write out a solution in plain language.
    Step 3: Translate the language into code.
    Step 4: Test the code in the computer.
  • Algorithms are step-by-step methods for solving problems. When writing an algorithm, it is important to keep in mind the algorithm’s efficiency.

Gem of Wisdom

Once we have an algorithm, we can compare it to other algorithms and pick the best one for the job. Once the algorithm is done, we can write a program to implement it.

1.4.2 Key Definitions

  • Algorithm: A step-by-step method for solving problems.

  • Algorithm ...

Get Computer Science Programming Basics in Ruby now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.