The document discusses several topics related to human cognition and software engineering best practices. It notes that human beings function best with proper sleep, diet, exercise and routines. It also discusses limits on human working memory and how code should be written in a way that is easy for humans to comprehend, like a story. Finally, it suggests practices like test-driven development and pair programming to help programmers work effectively.
“dhh stick with rails” — focus on computational efficiency
but neglect our most important tools
software engineering — not algorithms — human infrastructure
old joke: “mathematicians turn coffee into theorems”
mind is an incredible machine
to get the most out, learn how it works and how to maintain
good investment is quality machines — best investment in human infra
start with hardware
fail to care for hardware then software suffers — piku and anti-work
body not infinite capacity — what do we want to optimize hardware for?
strength/speed probably not important
consistent energy delivery — often ignored but keeps us in the zone
people obsess over getting more hours
pulling all-nighters, caffeine / nootropic drugs (alcohol joke)
goal is quality hours — image if all your hours were in the zone
most fundamental thing to getting quality hours…
don’t cut sleep to get more time — better hours, not more hours
wake at regular time, go to bed when tired — even weekends (jetlag)
alcohol reduces REM, sleep just as long, but less rested
my tool: bedtime on iOS — sleep important because it sets daily rhythm
our bodies have two rhythms: daylight and food (jetlag)
eating, sleeping, waking, and working at the same time every day
reduces stress, increases energy, and boosts focus
my tools: calendar everything, same schedule on weekends
you don’t need to live off organic tofu
but your brain can only work as well as the fuel you put in
insulin sensitivity and energy spikes
my tools: weekly meal planning, slow carbs, avoid processed food
exercise — documented benefits; endorphins, blood flow == brain good
don’t focus on the best, focus on what you will actually do
try things until you find what you like
my tools: first step / incrementalism / progress tracking
can not stress how important these are
consistent energy puts us at the top of our game
great hardware requires great software — to write great software…
good rubyists know the quirks of the language
creative professionals — most valuable tools are our minds
like any tool — optimal use — limitations
there’s a lot you might not know about your brain…
saccade blindness — narrow focus for the eye, so it moves
actually the fastest motion in the human body
> 20 degrees == head movement (half monitor)
long lines and functions are exhausting to scan
principle discovered by ancient typographers
limit to your working memory — degrades not drops
remember “almost right”
ever lose track of things while in a function? this is why
heard this before — joel spolsky and uncle bob
complaint: arbitrary rules, like straightjacket, bigger terminals
now you understand why? cognitive and physical limits
why matters — you can follow the rules and still end up with
extreme example — plenty of “small code” like this in production
this code (basically) follows all the rules — is “small code” not “readable code”
three bugs are hidden in this mess
readability really matters — because of how our memories work
writing 10k years, talking for millions of years
through oral tradition — method of loci (cicero the roman)
remember my story about the piku bug?
code that reads like a story
has a fast-track to understanding and long-term memory
…and saves energy!
if we refactor the above snippet…
everything is much clearer
knowing the rule is good, knowing why helps you apply it
another interesting aspect of human psychology
decision use energy (remember energy?) — limited per day
story: inmates up for parole, interviews
fall back on path of least resistance
discipline means choosing to do the right thing
habits are decisions that you have made beforehand
can’t rely on discipline — teach your brain to do the right thing automatically
many “best practices” are just good habits that leverage the brain
one example…
reward cycle — dopamine and serotonin
motivates with anticipation — then rewards — reward fades
how people get addicted to exercise — new car becomes just a car
this is motivation — this is why you do… everything; in programming
the goal is the feature, not writing tests
put the busywork first and it becomes part of the goal
tld relies on discipline, saps energy
birds sounding the alarm when a predator nears
Wernicke's area right behind the ear — speech processing engagement
headphones block most sound
what if you could productively engage?
engages the speech area of your brain, removes distraction
real-time code review (remember that reward cycle?)
review-later *can* work, but it takes more energy and discipline
energy is a biggie
stable energy and health through diet, exercise, sleep, and regularity
use memory limits, reward cycle, and decision fatigue to your advantage
by building habits
for a successful career — as well as a happy life
always forget — write articles on how to CTO
from management to teaching software engineering
any questions?