Zoonk icon

Software development

creation and maintaining of programs and applications

Write an article
Mistakes I made in code reviews and what I do now

I recently came across these tweets from David K. Piano about code reviews. It reminded me of comments I used to make while reviewing pull requests a couple of years ago: Reorder imports by grouping t

Numbers in Ruby

There are a few types of numbers available in Ruby. Let's see some examples: fruits = 10 lottery_prize = 42000000 price = 4.20 expression = 1 + 2i fraction = Rational(1, 3) precise_price = BigDecimal(

Data types in Ruby

When we're creating a variable in Ruby, we're also assigning a data type to it. For example, when we write something like this: car = "Tesla" We're actually telling our program to create a varia

How to declare variables in Ruby

Variables are values you can declare to use later. For example, let's say we want to save someone's name in our program. We can do it by declaring a new variable: name = "Nikola Tesla" In the exa

Hashes in Ruby

If you're coming from other programming languages, you might know hashes as a "dictionary" or an "object". Like arrays, can also store multiple items. But, different from arrays, you can access them

Arrays in Ruby

We've already learned about many data types such as strings, numbers, booleans, and symbols. Using , we can store many of those items in the same variable: cool_websites = ["zoonk", "khan academy"

Symbols in Ruby

Symbols are similar to strings but they are identifiers rather than data. They're different than strings, though, as you cannot change them. For example, if you call 10 times, it will actually crea

Strings in Ruby

Strings are text representations. You can use them to name things. For example: app_name = "Zoonk" scientist = "Albert Einstein" You can also join two different strings by using the sign: firs

Booleans and Nil in Ruby

In programming, a is like a toggle value which can be either or . For example, let's say you want to check a menu status (whether it's open or closed). You could create a boolean variable for that:

How to create classes in Ruby?

Classes are commonly used in Object-Oriented Programming (OOP). They help you define a basic model for creating objects. For example, let's create a class to handle data about movies: class Movie