myasoedov_harvest.jpg
Keynote: Stopping to Sharpen Your Tools

@brandon_rhodes
PyWaw Summit 2015
Warszawa
“Education consists of learning
specific skills (including how to learn)
and also acquiring attitudes.”
— J. Elmer Rhodes

He wrote about Mama

Note

His English grandmother

“I was very small when she
began to teach me to use tools,

Note

If your tools are faulty, then unless you can tell, you will often just blame yourself

Are your tools dull?

Are your tools dull?
How would you know?
I ran an amateur astronomy
sprint at PyCon 2015
Helping one of my attendees, I held
down Backspace to erase a line
The wait for it to
reach the beginning of
the line was terrible
Key repeat rate is a
very personal decision

Key repeat rate is a
very personal decision
but

Note

I asked permission to adjust it just for the day

keyrepeat.png
tracking-speed.png

Result

Win

Hypothesis

Many novice programmers
have no gauge on whether their
tools are wasting their time

Q:

How quickly and accurately
can you switch windows?

Note

Hypothesis — are IDEs popular because OS’s make it so hard to switch windows?

Q:

Can you indent and dedent code
without separately adjusting each line?

Q:

Does your editor run
pyflakes and flag errors
before you even run the code?

Q:

Can you automate repetitive
editing tasks with macros
or multiple cursors?

Q:

Do you use version control?

Q:

Can you use the Tab key for
both navigation and completion

Q:

Do you know the most
important 8 keystrokes for
editing with readline?
Previous / Next line     Ctrl-P  ↑↓  Ctrl-N
Back / Forward char      Ctrl-B  ←→  Ctrl-F
Back / Forward word       Alt-B  ←→  Alt-F
Beginning / End of line  Ctrl-A  ←→  Ctrl-E

Q:

Do you use interactive search?

Ctrl-R
  
  
Ctrl-S
Watching a skilled programmer
use basic tools can help you learn
which operations are supposed
to be simple and what is
supposed to be hard!
Konstantin Levin in
Tolstoy’s Anna Karenin

Note

(pronounced “Lay-vin”)

“being made very angry by the bailiff
he had recourse to his favourite means for
regaining his temper,—he took a scythe
from a peasant and began mowing.”
farmer_with_a_scythe.jpg
myasoedov_harvest.jpg
“He felt as he swung his scythe that
he was at the very end of his strength…
But at that very moment [the peasant]
stopped of his own accord—
“—and stooping
down picked up some
grass, rubbed his scythe,
and began whetting it.”
mow
scythe
whet

Note

You can tell what was important to the English by how they allocated monosyllables.

You will not mow effectively
if you pay attention only
to the work—the grass
Mowing a field involves
alternating your attention between
the grass and the scythe
All work involves
a rhythm — a balance —
between focus on the work
and focus on your tools

Q:

When is it time
to switch focus?

Transactions of the AMS, 1923

ams23.png
ams199.png

Transactions of the AMS, 1974

“At this point I regretfully
stopped submitting papers to the
American Mathematical Society, since
the finished product was just too
painful for me to look at.”

— Donald Knuth

In one of the more epic examples
of stopping to sharpen your scythe,
Donald Knuth took a year off to

Note

He reasoned that it was better to spend a year writing new tools than to try to get good results out of the old one.

Another famous example: Python!

“I realized that the development
of system administration utilities
in C was taking too long”
— Guido van Rossum,
“History of Python part 1”

Python saved time

It eliminated repetitive tasks
like hand-written memory allocation,
without suffering from the wats of
traditional scripting languages!

https://www.destroyallsoftware.com/talks/wat

Programmer productivity


Programmer productivity
is measured in
wat-1 hr-1
Remember yesterday’s talk
on going down Rabbit Hole?

Django Forms


Django Forms

Wats — all the way down?
TEX
Python
Those are expert moves
What about the rest of us?

Home Directory

Note

See my own home directory with ,home switch

Watch demonstrations

I had heard of the IPython Notebook,
but it was seeing Fernando’s 2013 PyCon
Canada keynote that made me use it!

https://www.youtube.com/watch?v=F4rFuIb1Ie4

Most novice programmers
hack away slowly at their
work with dull tools
But could there be an
equal and opposite error?
Dr. Dan Rocco showed me the book
The Seven Essentials of Woodworking
by Anthony Guidice
“Too many woodworkers thinker
and experiment with tools … and
avoid applying their skills
in the real world.”

Confession

I once disappeared into my tools

http://imgs.xkcd.com/comics/the_general_problem.png

http://xkcd.com/974/

What should govern
the investment in tools
that we make with our time?
  1. Repetition
  2. Traction

Repetition

Programmer, jit thyself!

Repetition

Programmer, jit thyself!
Boredom is a key skill

Traction

As long as you are making
progress, keep coding

Traction

If it feels like I am flailing and
making random changes to code
then I stop to work on my tools
But, traction
can be dangerous
it can pull me in the direction
of less important problems
if they inspire less fear

Two solutions

  1. Fight your emotions
  2. Develop more traction

Traction

Practice creating traction
so that you decide direction,
instead of your tools and fears
setting your direction for you

Examples

What tools have I adopted recently
in response to repetition and
problems with traction?

pydoc

Jedi

ag

Magit

Note

Users complained online about the diff format. It took me one day, and I could read it fine.

My next tweak?

hilary-font.png
no_ligatures.png
all_ligatures.png

Tooling

lifelong process
Can take months or years
to notice a pattern and learn
how to automate it away

Q:

Which is the most important
instrument to keep sharp?

A:

Yourself

Ola, talk yesterday

“Are you hungry? Thirsty?
Set a timer. Plan a break.”

self-awareness

Note

My mood is often completely changed, when blundering around the kitchen at night, from simply turning on enough light.

You don’t merely need
to be aware of your tools
You need to be aware of yourself
myasoedov_harvest.jpg

Note

So, why did I quote that passage from Tolstoy?

“being made very angry by the bailiff
he had recourse to his favourite means for
regaining his temper,—he took a scythe
from a peasant and began mowing.”
Remember what drew my attention
to the key-repeat rate at the sprint?

Remember what drew my attention
to the key-repeat rate at the sprint?
My frustration

Thank You! — @brandon_rhodes

farmer_with_a_scythe.jpg myasoedov_harvest.jpg
Images — Peasant by Jan Piotr Norblin;
Time of harvesting (Mowers)
by Grigoriy Myasoyedov