Practical Linked List in Ruby

This is the 3rd entry in the “Practical Computer Science in Ruby” series! Today we are going to talk about linked list. So what’s a linked list? Like the name says, a linked list is a way to store data in a list format (thanks, Captain Obvious!). The “linked” part comes from the fact that … Read more

Everything You Need to Know About Ruby Constants

What is a constant in Ruby? A constant is a type of variable which always starts with a capital letter. They can only be defined outside of methods, unless you use metaprogramming. Constants are used for values that aren’t supposed to change, but Ruby doesn’t prevent you from changing them. They look like this: Now: … Read more

The Hidden Costs of Metaprogramming

Metaprogramming sounds like a very fancy word, but is it any good? It can be useful, but many people don’t realize that using metaprogramming has some costs. Just so we are on the same page… What is metaprogramming exactly? I define metaprogramming as using any method that: Alters the structure of your code (like define_method) … Read more

There Is No Magic in Ruby

You may have heard (or even said yourself) that Rails / Ruby has too much magic… But where does that idea come from? What is Rails magic exactly? And what can you do to dispel that magic? Here’s what I think: When something feels like magic it’s because there is something you don’t know, there … Read more