Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This largely concurs with clean architecture[1], especially considering his foreword containing hindsight.

Clean architecture can be summarized thusly:

1. Bubble up mutation and I/O code.

2. Push business logic down.

This is how it's stated in [1]:

> The concentric circles represent different areas of software. In general, the further in you go, the higher level the software becomes. The outer circles are mechanisms. The inner circles are policies.

Inlining as a practice is in service of #1, while factoring logic into pure functions addresses #2, noted in the foreword:

> The real enemy addressed by inlining is unexpected dependency and mutation of state, which functional programming solves more directly and completely. However, if you are going to make a lot of state changes, having them all happen inline does have advantages; you should be made constantly aware of the full horror of what you are doing. When it gets to be too much to take, figure out how to factor blocks out into pure functions (and don.t let them slide back into impurity!).

1: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-a...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: