# A Philosophy of Software design
Talk by John Ousterrhout
https://www.youtube.com/watch?v=bmSAYlu0NcY
We have been building software for a long time but software design is a black art.
One concept in computer science above all?
- Layers of abstraction (Don Knuth)
- Decomposition - complicated system to pieces so you can build infinitely
"10x programmer" - google term for a great programmer
Why are some programmers better than others?
"Talent is overrated" - Geoff Calvin book - difference is how much they practiced
CS190 course - he created course similar to English writing class
- Write code for 3 weeks (10 weeks total) (2000-3000 lines)
- review and revise
- do another project
What are the secrets? Vague ideas
* Working code isnt enough; minimize complexity
* complexity comes from dependencies and obscurity
* **Strategic vs tactical programming**
* Lack of strategic thinking leads to spaghetti code
* "Tactical tornado" - a person you is really good at cranking out code that works 80% of the time and leaves a wake of destruction behind
* "investment mindset" - invest time now so payoff will be later
* Startups tend to think tactical. But their codes end up as mess
* **Classes should be deep**
* David Parnas paper 1970s - classsic paper in design and s/w engineering.
* If class is a rectangle where area defines the benefit the class offers, and the top of the rectangle is the interface, then the rectangle should be deep not wide. meaning it does more things than the limited interface it offers to the system
* General purpose classes deeper
* new layer, new abstraction
* Define errors out of existence
* try to minimize the places where you have to handle exceptions. Dont make people handle an exception with more code. doesnt mean no exception handler
* Comments should describe things not obvious in the code
Red flags - you see these behaviours you are probably in toruble
---
Related: [[Software Design]]
Date: December 28th 2020 23:21 PM