The Principles of Ruby
Ruby has a few design principles to make programming in the language less stressful and more fun for programmers of other programming languages. These design principles are:
Principle of conciseness: In general, short and concise code is needed to create programs. The initial set of steps to run a program written in English is often referred to as pseudo-code. Ruby is designed so as little additional effort is needed to translate pseudo-code into actual code. Even existing Ruby commands can be made more concise. For example, Ruby’s if statement can be written in three lines or just one.
Principle of flexibility: There are multiple ways to accomplish the same thing, and even built-in commands can be changed. For example, when writing an if-else statement you can use the words if and else, but you can also accomplish the task with a single “?”. The following code both perform the same task.
if 3>4 puts "the condition is true" else puts "the condition is false" end
puts 3>4 ? "the condition is false" : "the condition is true"