Home

Depend on behavior, not on data

This is one of the most powerful pieces of advice in OO programming I’ve ever received. It means that objects shouldn’t be seen just as a collection of data structures. Instead, you should visualize them as software entities that can respond to messages and answer questions about themselves. We achieve this by hiding away implementation detail...

Read more

Things I wish I had known when I started programming, Part 8

Yepp, more things I wish I’d known when I started, 8th edition. You can find the first article in the series here. And the previous article here Programming is not about memorizing, it’s about understanding When I started programming I felt very frustrated when I tried to write simple things just to find out I forgot some syntax details. I c...

Read more

Writing good software comments II

In a previous article, we talked about the importance of comments in software development. Even though they are powerful tools for improving the readability of our code, we should use them with care. A good comment can make the code easier to understand, but a bad one can harm your productivity. Bad comments clutter your editor and make code h...

Read more

Writing good software comments I

Comments are, to put it mildly, a controversial topic. There are two very strong opinions in software development, both extremely popular and widespread. The first one states that comments are evil, and you should not use them under any circumstance. The main argument is that instead of using comments, you should try to make the code as readabl...

Read more

Ruby iterators and the yield keyword (with examples)

Ruby iterators and the yield keyword Ruby iterators are a special type of method supported by collections. They are like any other regular method, but they receive an additional input in the form of a code block. Iterators are one of the most useful features of the Ruby language, and using them effectively is a great way of creating clean metho...

Read more

Things I wish I had known when I started programming, Part 7

Yepp, more things I wish I’d known when I started, 7th edition. You can find the first article in the series here. And the previous article here Test your code Writing tests is one of those things that you appreciate more as you gain experience. In the beginning, it’s hard to understand why we need tests. I know it works, how do I know it w...

Read more