Advanced Logic in Ruby

In addition to the basic programming logic that Ruby has, it also has a few weirder forms of logic it can employ. Single Line Conditions Ruby allows for single line conditions where it is almost like a short hand. However, doing so may seem backward to normal logic, because the true block goes first. Consider…

Basic Logic in Ruby

In Ruby, you’ll find that all of the standard logic operators that most languages have, are supported. Symbol Meaning < Less than > Greater than == Equals != Not equals >= Greater OR equal to <= Less OR equal to Conditionals Of course, conditionals such as an if statement are also possible within Ruby. Similar…

Your First Ruby Program

As with most languages, we always want to start with a “Hello World” program. Remember, this is to make sure everything is working, as much as it is to learn the programming language. For simplicity’s sake, we’re going to use the online editor: https://www.jdoodle.com/execute-ruby-online or https://www.onlinegdb.com/online_ruby_compiler You will notice right away that in Ruby, we…

Goroutines and channels

One of Go’s initial design requirements was to make it easy to create multi-threaded applications. While many languages support multi-threading, it’s not always easy to implement. Go wanted to make it easy to do this. Consider the following code where it runs sequentially. If you run this, every function call to PrintHello() has to complete…