News for hackers. Stuff that matters.
Re:Ask HN: Do you use any mental models to design and develo... by nanonan on Friday February 19, 2021 @06:46AM (#26192089)
Generally (and I'm not sure if these are really mental models, but often are in my head as a code, and I would imagine are quite obvious to any developer above entry level): Red Green Refactor, YAGNI, Dry, SOLID, and IoC.

When it comes to choosing design patterns I usually lean towards KISS, and prefer less code.

Cyclomatic Complexity is the enemy of maintainable software and naturally arises when users request new features and grows exponentially with the number of users and/or developers. Because of that I do prefer Cowboy Coding - it handles one side of that count. Reflexively I'll argue with new requests and try and predict what else can go wrong or what unintended outcomes will be that will lead to more user requests or complexity. One pattern I often use in my head is to imagine software as biological systems, evolving ecosystems in tandem with users. There's a sort of evolutionary arms race between growing user stories, making the business money, and Conway's law. I try and stick to the 80/20 rule as often as I can when refactoring and making changes and often consider the biological paradigm Structure/Function when designing. I consider it a win when the system is either less technically complicated or the use case is simpler (less steps for a users workow) after I've touched it between releases.

Re:Ask HN: Do you use any mental models to design and develo... by hkazemi on Friday February 19, 2021 @07:09AM (#26192245)
Thanks this is really great answer. In fact I've noticed that the more experiences developers use "mental models" daily without knowing it.

For example that 80/20 rule you mention is actually a mental model called Pareto Principle, or Negative Space model when doing a binary search, etc.