Tag Functional Style

Temporal coupling and Immutability

This topic is partly covered in my Applying Functional Principles in C# Pluralsight course, Module 2. Here, I’d like to elaborate on how temporal coupling and immutability are related to each other. Temporal coupling Temporal coupling is coupling that occurs when there are two or more members of a class that need to be invoked in a particular order. A common example is the following: var calculator = new PriceCalculator(); calculator.

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.

OOP, FP, and object-relational impedance mismatch

Today’s topic is gonna be about OOP, FP, and object-relational impedance mismatch. The goal of this article is to show how object-oriented and functional paradigms deal with relational data stores.

How to know if your Domain model is properly isolated?

In this post, I’ll show a simple way to get to know if your domain model is properly isolated.

Law of Demeter and immutability

In this post, we’ll discuss the Law of Demeter in the context of immutability.

Growing Object-Oriented Software, Guided by Tests Without Mocks

This is a review of the Growing Object-Oriented Software, Guided by Tests book (GOOS for short) in which I’ll show how to implement the sample project from the book in a way that doesn’t require mocks to be tested. Growing Object-Oriented Software, Guided by Tests Without Mocks Let me first explain why I’m doing a review of this book. If you read this blog regularly, you probably noticed that I’m pretty much against using mocks in tests.

C# functional extensions NuGet library

I’ve created a NuGet package out of the functional extensions I wrote about in this post series and in my Pluralsight course. C# functional extensions NuGet library Thanks to one of the listeners of my Functional C# course, I finally made a separate NuGet package which is based on the Result class I wrote about awhile ago. The package contains the following classes: Result ResultExtensions

Pragmatic unit testing

The topic described in this article is part of my Unit Testing Pluralsight course. This post is about pragmatic unit testing: how to get the most out of your unit test suite. Pragmatic unit testing: black-box vs white-box Pragmatic unit testing is about investing only in the tests that yield the biggest return on your effort. In the previous posts, we discussed what traits a valuable test possess (high chance of catching a regression, low chance of producing a false positive, fast feedback) and how various styles of unit testing (functional, state verification, collaboration verification) differ in terms of their value proposition.

Immutable architecture

The topic of immutable architecture described here is part of my Applying Functional Principles in C# Pluralsight course. In this post, I’d like to show a common approach to introducing immutability to your code base on an architectural level. Immutability, State, and Side Effects Before we start, let’s take a minute to define the terms. Most likely, you have already encountered them but I want to make sure we are on the same page here.

What is functional programming?

The topic of functional programming described here is a part of my Applying Functional Principles in C# Pluralsight course. In this article, I’ll try to answer the question: what is functional programming? Functional programming So, what is functional programming? This term arises quite often and every author writing about it gives their own explanation. I’m no exception. In my opinion, the simplest and at the same time precise definition is the following: functional programming is programming with mathematical functions.