Ruby Is Hiding Errors From You!

Ruby will intentionally hide some errors & exceptions from you. Sometimes this can be useful. Like when using the Kernel#loop method with a block, the loop will stop when a StopIteration exception is raised. But other times this can make your debugging sessions a lot harder. Let’s see some examples! Hidden Exception: Comparable Module + … Read more

Learn to Implement & Use Prefix Trees in Ruby

A prefix tree (also known as a trie) is a data structure that helps you organize a word list & quickly find words that start with a specific prefix. For example, you can find all the words in your dictionary that start with the letters “ca”, such as “cat” or “cape”. Look at this picture: … Read more

Performance Improvements in Ruby 2.5

New Ruby versions keep improving & Ruby 2.5 is no different. Ruby 2.5 introduces these optimizations: String interpolation will be around 72% faster when a large string is created String#prepend will be around 42% faster if only one argument is given Enumerable#sort_by, Enumerable#min_by & Enumerable#max_by will be about 50% faster Let's see some benchmarks! String … Read more