#abstraction
This tag covers topics related to simplifying complex concepts by creating understandable layers, patterns, or models. It includes discussions on design patterns, functional programming, and strategies for making code easier to maintain and communicate.
2024
Barricade + choke point 🛡️
Two design patterns that I’ve found helpful when designing systems to deal with untrusted data.
Algebraic data types 🧩
·14 mins
Compose types and use them to represent complex data in a clean and type safe way.
Same level of abstraction ⚖️
To make something easy to understand, its parts should be at the same level of abstraction.
Abstractions as communication 📣
Create abstractions to communicate intent to your fellow programmers.
Put uncertainty in a box 📦
I put stuff with too much uncertainty in a box and don’t think about it until I know more.
There is no loop 🥄
Learn to move from imperative
while
and for
loops to declarative collection functions like map
and filter
.
Constructors and creation methods 🏗️
Use creation methods when a constructor fails to fully capture the programmer’s intent.
Testable code is reusable code ♻️
Testability and reusability goes hand in hand. When you test a function, you run the code in another context than it was built for.
Remove temporal dependencies ⏰
How to avoid “temporal dependencies” where things must be done in a certain order.
Functional foundations ⚙️
·23 mins
A selection of functional programming concepts that I feel are helpful to all developers.
2014
Convert guard clauses to value objects
How replacing validation functions with types can make your code safer and more expressive.
2012
How unit testing changes your design
Most complexity should be in classes with few dependencies, and most dependencies should be in classes with little complexity.