←back to thread

1457 points nromiun | 5 comments | | HN request time: 0s | source
Show context
exclipy ◴[] No.45077894[source]
This was my main takeaway from A Philosophy Of Software Design by John Ousterhout. It is the best book on this subject and I recommend it to every software developer.

Basically, you should aim to minimise complexity in software design, but importantly, complexity is defined as "how difficult is it to make changes to it". "How difficult" is largely determined by the amount of cognitive load necessary to understand it.

replies(11): >>45077906 #>>45077954 #>>45078135 #>>45078497 #>>45078728 #>>45078760 #>>45078826 #>>45078970 #>>45079961 #>>45080019 #>>45082718 #
YZF ◴[] No.45078760[source]
The problem is no set of rules can replace taste, judgement, experience and intuition. Every rule can be used to argue anything.

You can't win architecture arguments.

I like the article but the people who need it won't understand it and the people who don't need it already know this. As we say, it's not a technical problem, it's always a people and culture problem. Architecture just follows people and culture. If you have Rob Pike and Google you'll get Go. You can't read some book and make Go. (whether you like it or not is a different question).

replies(9): >>45078947 #>>45079055 #>>45079393 #>>45079903 #>>45079931 #>>45079994 #>>45080208 #>>45080993 #>>45083102 #
1. braebo ◴[] No.45078947[source]
I’m accustomed to this principle as a musician, so it’s been interesting to see it withstand my journey into software.
replies(1): >>45079180 #
2. dlivingston ◴[] No.45079180[source]
Can you expand on this?
replies(1): >>45079886 #
3. hakunin ◴[] No.45079886[source]
Not the commenter, but also had experience with making music and writing software. I think the same applies to any creative endeavor. It’s super hard to consume what you produce as “someone else” (I.e. read what you write, listen to what you compose with fresh perspective). Usually it takes time to forget and disassociate from your work, because you get too used to it while producing it. Coming back to it another day can work sometimes, but very quickly you’ll get used to it again. I think this is one of the most effective ways to achieve quality tasteful results in anything. If you can train yourself to read your own code with fresh eyes almost as soon as you write it, you’d be unlocking a powerful shortcut, a cheat code to life. It’ll make the biggest impact on your code’s (and any other creative work’s) quality. This is also why sometimes you can spend hours painstakingly trying to design something, and it comes out terrible, nobody likes it. And you can do something in 20 minutes just improvising your way through, and it comes out an elegant masterpiece. That’s because you never gave yourself time to “get used to” your work such that you couldn’t perceive the problems with it anymore. You maintained that fresh impatient perspective the entire time.
replies(1): >>45080797 #
4. teiferer ◴[] No.45080797{3}[source]
> If you can train yourself to read your own code with fresh eyes almost as soon as you write it, you’d be unlocking a powerful shortcut, a cheat code to life.

This is really a key takeaway here: Always keep your audience in mind. When programming, you have two audiences: the machine executing the code, and fellow programmers maintaining the code. Both are important, but the latter is often neglected and is what the article is about. Optimize for your human audience. What will make it easier for the next person to understand this? Do that.

Like public speaking or writing an article. A great talk or a article happen when the speaker/author knew exactly how the audience would perceive them.

replies(1): >>45080840 #
5. hakunin ◴[] No.45080840{4}[source]
Agreed, I wrote more in depth about it a few years ago: https://max.engineer/maintainable-code