Lay Out Your Code Like You'd Lay Out Your House
frederikcreemers.be
Lay Out Your Code Like You'd Lay Out Your House
1–10 of 47 posts
Re: Lay Out Your Code Like You'd Lay Out Your House
#2Re: Lay Out Your Code Like You'd Lay Out Your House
#3Re: Lay Out Your Code Like You'd Lay Out Your House
#4Re: Lay Out Your Code Like You'd Lay Out Your House
#5[1] https://github.com/erikras/ducks-modular-redux/blob/master/R...
Re: Lay Out Your Code Like You'd Lay Out Your House
#6However..in my experiences thus far, this type of cohesion becomes increasingly complex and open to individual interpretation when you are dealing with more complex business domains. Say for example, several different types of customers engaging in several different types of transactions that have just enough differences in implementation to be several distinct models. Often there are several reasonable ways to interpret "functionality", and you end up with a situation where you are actively building what can be a fairly tricky form of technical debt over the course of years as developers come and go. From what I have experienced, the best way to avoid this, is of course more formality on the development team about structuring what goes where, but then you just end up with a different but still just as rigidly enforced structure as the first example from this article. It also has the downside of being non-standardized.
If I were going into some creature's "house", when they may very well be an alien creature whose domain and existence I understand little of, I personally feel most safe in the house that had the more "absurd" structure. I may have to walk down a few more hallways, but I won't blast myself with a ray gun looking for a faucet.
Re: Lay Out Your Code Like You'd Lay Out Your House
#7Ironically the page layout is broken on my iPhone using safari. One can debug this with desktop safari by going into responsive design mode (forget what it’s called)
Re: Lay Out Your Code Like You'd Lay Out Your House
#8But I found the first motivating example (refactoring is hard) to be a poor argument in favor of cohesion. When making a breaking public API change, types and the ensuing type errors are going to be a way more powerful guiding force for identifying affected usage sites than cohesion. Of course, his examples were in Python, so maybe the author doesn’t have such luxury.
Re: Lay Out Your Code Like You'd Lay Out Your House
#9Re: Lay Out Your Code Like You'd Lay Out Your House
#10For content, I agree, but houses also have plumbing, an electricity network, heating, etc