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…

Working with Maps in Go

Working with a Map in Go is like Dictionaries in Python, or Maps in Java. A Map stores information as key/value pairs. This is a nice thing about data structures, they are often found in other languages. Defining the Map When you define one in Go, you need to define the variable as a type…