trying to migrate away from jeckyl

This commit is contained in:
dreat 2026-02-12 13:27:42 +01:00
parent 1493aec245
commit b7a790461b
No known key found for this signature in database
GPG key ID: B24F8F4D3724EE54
22 changed files with 2538 additions and 0 deletions

16
notes/solid for fp.md Normal file
View file

@ -0,0 +1,16 @@
---
title: SOLID for FP
tags: se, fp
---
<status>Status: 🌱 </status>
I have OOP brackground and used SOLID and other OOP techniques to make my code better.
Since then I switched to FP and feel like there's not enough `guidelines` for writing FP code. At the same time I have a hunch that some of the OOP wisdom can be applied here.
- **S**ingle Responsibility Principle - this one is easy and free to take. Just make sure that your methods have "one reason to change" - a single responsobility. Make them small and specialized. Anything with `and` in name can be a sign that there's too much going on
- **O**pen Close Principle - this one is trickier, but if we say that refactoring is flow of making code open to extension - this makes things easier to adapt. Basically you want to be able to add new functionalities withtout altering existing code - and this can be achieved in FP.
- **L**iskov Substitution Principle -
- **I**nterface Segregation Principle -
- **D**ependency Inversion Principle - can be argued to go with "top level module" as main dependency, instead of more specialized ones.