Lately, I re-read the book: The Pragmatic Programmer
The Pragmatic Programmer from Andy Hunt and Dave Thomas is a classic and the updated version is even better. The 20th Anniversary edition came out in 1999 and is 320 pages of great advice on how to effectively approach software development.
The audible book is great to, I find myself listening to bits of it as I walk and it continuously re-enforces good practices and it keeps me in check over time. A large part of hyper63 is to help developers build applications using the principles found in this book.
- Fight software rot
- Learn continuously
- Harness the power of basic tools
- Test ruthlessly and effectively
- Delight your users
To name a few.
The book does a great job in discussing business logic and separating your implementation details from your business logic. Thinking about your solutions in terms of a pipeline where information travels from A to B and leveraging functional concepts to apply rules and filters along the way. This was such an important mindset shift for me. Before, I was thinking in terms of solving specific problems in a logic flow with objects, which over specialized my solutions and lead me to create solutions that were difficult to maintain and manage. 👨💼
By changing my mindset to think in terms of pipelines and flow, I was able to deconstruct my complex embedded logic of state and loops into a series of generic functions, like legos to apply to my special data set. Like a pipeline that takes input and transforms into new output. When working on solutions using this mindset, I am able to re-use so many generic functions, compose them together to create better results. And drastically reduce my specialized code surface area, which results in developer happiness. 😎
Easier to Test
When testing pipelines you control the flow, you control state because it is passed from one step to another, no risk of the outside world changing your logic. This is the advantage of working with pure functions, they create encapsulation by not knowing anything but their input and output. This results in reliable unit testing that is easy to create and provides a lot of value. 🛠️
Ship with confidence
By changing my mindset to isolate my business logic into transformation pipelines of pure re-usable functions and types, I am able to ship features with much more confidence that they will work and when they fail the signal/cause will be high. Because I am decreasing the surface area and isolating my business logic in these composable transformation pipelines that leverage well tested generic functions. I am currently using libraries like
ramda to give me the generic tools to assemble my business logic. But these libraries or built on common principles found in the Fantasy Land spec. 🚀
If you are writing code and solving problems but find it harder and harder to continuously learn, continuously ship and keep fighting the complexity your previous self and team has created? I highly recommend you read the pragmatic programmer and give some thought to changing your mindset on how you approach solutions. There are so many great general pure functions that already do a lot of the code you write every day, why not leverage those general tools and reduce your specialized code. I am happier for it every day, I think you might be too! ⚡
Check out hyper63 a service framework that creates a boundary between common services and your business logic. https://hyper63.com