
This blog post is the written form of my presentation about how simplicity enables an evolutionary software architecture.
I dared to ask two questions on twitter:
What makes your daily developer life easier in F# compared to C#?What is better in C# than F#?
This post summarizes the answers and my own opinion on where C# and F# shine.
Prepare for a long post about how we persist data with F# using Dapper into (Azure) SQL Server. I will also show, how we can run our tests either with an in-memory database simulation or a real database. As always, if you spot something that can be improved, please let me know. We are still learning…
We had one kind of defects in our C# that was very annoying: hidden usage of equality and missing equality members on involved classes.
We invested a lot of time to get rid of these in our C# code. Luckily, in F#, this problem does not exist because of the compiler.
But, let’s start at the beginning…
The application we are developing – it’s TimeRocket, just in case you forgot 😉 – has quite a lot of code that looks something like this (pseudo-code): given is an identifierload the data represented by the identifier if it existsif the data could be loaded, validate if the desired action can be executedif it can then continuereport back success or what failed In C#, we often resort to exceptions because otherwise, we get a pyramid of doom. So it’s time for one of the...
In C#, our preferred way to define a builder is using a fluent syntax. Whether it is setting up the system under test in our specifications by defining how we want external calls to be faked, setting up complex test data or defining the steps to be executed in an operation with automatic compensation in case of an exception. In F#, this works, but feels weird, because a fluent syntax typically uses classes and/or extension methods and there are a lot of . involved. So we experimented with a...