Problems with nil and how to avoid them

Have you recently got an exception saying NoMethodError: undefined method `name' for nil:NilClass? Most likely more than once. And how did you solve it? Maybe you used try and thought the problem is solved… until the same exception happened in a different place! Using methods like try is just treating symptoms, it doesn’t even touch the real problem. Maybe the right question would be: why was it nil in the first place? Could it be avoided? Was the possibility of nil a desired behavior? And why at all is nil even a problem? Let’s find out and investigate some usecases.

Continue reading...

Working with Perfect Programmers

I’ve always liked new beginnings, with all the possibilities they bring. And what better way to start fresh with a blog than by writing about one of those first impressions you get when you embark on a new adventure? For me, it was a new job, a new environment, and a completely different approach to work. So, please, fasten your seat-belts and enjoy one of the latest and craziest rides of my life - the introduction to the programming world.

Continue reading...