What is an exceptional situation in code?

This is a continuation of the topic of error handling. We’ll discuss what an exceptional situation in code actually is and see some examples of it.

Error handling: Exception or Result?

In this post, we’ll look at some practical examples of error handling. We will see whether it is better to use exceptions or the Result class to deal with errors.

Interfaces for repositories: do or don't?

Today’s topic is about interfaces for repositories. Should you introduce them? Or maybe it’s better to use repositories as is? Let’s see.

On Automappers

This post is about some bad practices in using automappers.

REST API response codes: 400 vs 500

Today, I’d like to talk about the (sometimes subtle) difference between 4xx and 5xx response codes when programming a RESTful API. I’ll try to show when to return what code (400 or 500) and introduce a simple way to implement this logic on the server side.

How long should a single method be?

This topic might seem trivial, especially if you look at all other articles that have beaten it to death already. But I would still like to make a couple of important points here. So, how long should a single method be?

2016 retrospective

I already did this thing last year, so I thought I would do it again. Below is an overview of the articles I posted this year and a little bit of reflection on them. Retrospective It’s interesting to look at the progression of blogging topics throughout the whole year. They mostly followed the Pluralsight courses I was working on at the time. While writing a course, I remember finding lots of ideas that were worth extracting into a separate self-contained blog post.

Custom exception types

Today’s topic is about custom exception types. That is whether or not you should write your own exception types to throw in different situations.

OCP vs YAGNI

In this post, I want to cover the topic of OCP vs YAGNI - contradictions between the Open/Closed Principle and the You aren’t gonna need it one. OCP Let’s start with a refresher for what OCP is. The Open/Closed principle states that: Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. It was first introduced by Bertrand Meyer in his canonical Object-Oriented Software Construction book.

When to include external systems in testing scope

Should you always mock out your database? Or should you include it in the unit/integration testing scope? What about other external systems? This post is based on my Pluralsight course about Pragmatic Unit Testing. Two types of external dependencies When it comes to external dependencies (dependencies outside the process that hosts your application, such as a database, a 3rd party system, etc.), there’s no single guideline regarding how to work with them in tests.