The Open/Closed Principle
The Open Closed Principle is responsible for the ‘O’ of the S.O.L.I.D principles. Originally coined by Bertrand Meyer, it states that:
Software entities (classes, modules, functions, …) should be open for extension but closed for modification
It seems like an incredibly simple principle, but it’s behind most of the best practices we use wh...
4 Unhealthy developer habits and what to do about them
All professions have occupational hazards and risks, and software development is no exception. While it’s true that we rarely have to deal with man-eating sharks or explosions, ignoring some of our profession’s challenges can lead to lots of trouble.
The good news is that most of our problems are the result of some form of neglect. Fixing them ...
Ruby modules in-depth
Modules are incredibly flexible and powerful constructs that help you organize your code in a more… modular way. They let you package related functionality in a cohesive unit you can use to extend the behavior of objects and classes.
Using modules to bundle together related behavior
Ruby gives you two options to bundle behavior into units: clas...
RESTful Services: what they are, and what they aren't
REST is one of the most important concepts in today’s web-centric development circles. You’ve probably heard about it even if your main focus isn’t web development. Despite its popularity, there’s a lot of confusion about what it really is. Let’s take a look at some concepts to better understand what it means to be RESTful.
It all starts with a...
Things I wish I had known when I started programming, Part 3
Yepp, more things I wish I’d known when I started, 3rd edition.
You can find the first article in the series here.
And the previous article here
Beware of the arrogance trap
Arrogance is one of the worst traits a professional can develop.
It’s not only about how it affects our relationship with other people, but that’s also worth considerin...
The Single Responsibility Principle
The Single Responsibility Principle is probably the most confusing of all 5 S.O.L.I.D principles. It took me quite a while to understand why it’s an important thing, and where to apply it. The phrasing has changed through the years, but in most places, you will find a variant of the following idea:
A module should have one, and only one reas...
Defensive Programming Fundamentals
When your program starts running in production, the conditions and cases you thought impossible will happen, period. In reality, it’s impossible to ensure that your code will have optimal running conditions all the time. As a developer, you’d like to ensure your projects will be able to cope with the imperfections of the real world. That is why ...
Writing good variable names
There are only two hard things in Computer Science: cache invalidation and naming things
_Phil Karlton
Despite being one of the easiest ways of improving the quality of code, writing good variable names is perhaps the most overlooked skill in a developer’s toolbox. Sharpening your naming chops is a sure way of improving your code’s readabi...
85 post articles, 11 pages.