A pleasant walk through computing

Comment for me? Send an email. I might even update the post!

Weekly Sugar: When is Music a Distraction?

Developers often listen to music while programming. But, like teenagers who rock out when trying to do math homework, are we doing ourselves a favor?

The research so far shows that listening to music during repetitive work can boost productivity. Fine if we're creating lots of classes that follow a pattern.

But what about creative or demanding cognitive work such as intensive debugging, having to hold a dozen dependencies in mind at once for thirty minutes? Then, music can be a serious distraction. Often, the best solution at those moments is to turn off the music, or use ambient/white noise to mask office sounds.

Developers spend lots of time in demanding mental activity. Find music that doesn't distract you, and be mindful if it is. Change your music to change your mind.

References

"Yes or No?" -- A Classic and Effective Book For Decision-Making

In 1991, when I was working for Waldenbooks, we received an advanced reading copy of Dr Spencer Johnson's "Yes" or "No": The Guide to Better Decisions.

It became a treasured item for two reasons. One, I found it a terrifically practical decision-making method. Two, the advanced version was, in my opinion, better than the published version. I'll explain the difference later, but first, about the book.

Like others Dr Johnson authored or co-authored (The One-Minute Manager, Who Moved My Cheese?), the book is written in story/fable style. This was kind of the rage at the time, and in the wrong hands can be annoying. But in the case of Yes or No, I never felt condescended to. It was clear that each page, each paragraph, was carefully thought out.

The book is about a hundred pages long, with larger type, and will take you only about an hour to read. It could be one of the most valuable hours of your life.

Here's a summary of the system, which literally fits on a credit-sized card. The questions are so clearly designed that they don't really need explanation--but read the book anyway!

  1. Make a tentative decision
  2. Ask Three Practical Questions
    1. Am I pursuing the real need?
    2. Am I informed of my options?
    3. Have I thought this through to a better result?
  3. Ask Three Private Questions
    1. Am I really telling myself the truth?
    2. Does this decision really feel right to me?
    3. Do my actions show I believe I deserve better?
  4. If all six answers are Yes, proceed. If any answer is No, rethink the decision.

The first three questions are "head" questions. They gather and analyze information. The second three questions are "heart" questions. They make you check in with your conscience and look backward from your future self as if the tentative decision had already been made.

The first several times I applied the system it took awhile. But in time I started integrating the questions. I haven't gone strictly through the system in years, but I know I'm still influenced by it.

Here are some of the lessons in the book.

My poor decisions are based on illusions I believe. My better decisions on realities I recognize.

I stop a poor decision to make a better decision

I use my head to ask probing questions, and my heart to find better answers.

My decisions reveal my beliefs about my integrity, my intuition, and myself.

Once I see the truth, I make a better decision

My feelings often forecast my results.

I get results I really believe I deserve.

We are each our own guide to better decisions, and we can help others discover this for themselves.

What change did Johnson make in the final version, and why don't I like it? Here's the exact statement printed in the front matter.

While I understand the impetus to streamline, I really think breaking down the questions leads to better answers. It forces the person to think about each one, adding time and care.

The book has a handy wallet card, which I carried for years before it fell apart. Below is the original, followed by the published version. You can decide for yourself which you like!

Oh, and a final little story. My original copy of Yes or No accidentally got wet, moldy, ucky. I finally let it go several months ago. Then, a week ago, I realized I wanted to reread the book and write a summary. My wife got me a copy through Paperback Swap. Imagine my surprise and great delight when what arrived in the mail was the advanced reading copy! That was a good decision.

"My" Git Aliases (with a nod to Smith and Jones)


(Pete Duel, we miss you.)

And by "my", I mean mostly other people's. I've just renamed and/or tweaked them. Thank you, Phil Haack!

Here's my GitHub dotfiles repo.

https://github.com/bladewolf55/dotfiles

Reference
Include my Git Aliases | You’ve Been Haacked

[alias]
  # HISTORY AND STATE
  st = status -s
  # List all branches
  branches = branch -a
  # Displays last 10 commits by default, or the supplied number of commits
  hist = "!f() { git log -${1-10} --pretty=format:\"%C(auto) %h %ad | %d %s [%an]\" --graph --date=short; }; f"
  # All branches
  hista = "!f() { git log -${1-10} --pretty=format:\"%C(auto) %h %ad | %d %s [%an]\" --graph --date=short --all; }; f"
  # Generate zip of file differences between two commits. Second commit defaults to HEAD.
  diffpatch = "!f() { git archive --output=diffs.zip HEAD $(git diff --diff-filter=d --name-only $1 ${2-HEAD}); }; f"
  # Show renamed or added files
  diffshow =  "!f() { git diff $1 ${2-HEAD} --name-only --diff-filter=AR; }; f"
  
  # CURRENT CHANGE
  save = !git add -A && git commit -m 'SAVEPOINT'
  undo = reset HEAD~1 --mixed
  # Hard reset to previous ref, but saves current state first
  restore = "!f(){ git add -A && git commit -qm 'RESTORE SAVEPOINT'; git reset $1 --hard; }; f"

  # GROW, MARK, TWEAK
  co = checkout 
  cob = checkout -b 
  # Commits using supplied message, or opens editor if message omitted
  # cm = "!f() { git add -A; [ -z \"$1\" ] && git commit || git commit -m \"$1\" ; }; f"
  # This version lets you continue after entering the first line of the message, and ends when double-quote is entered
  cm = !git add -A && git commit -m 
  # Commit and amend, opens editor
  cma = !git add -A && git commit --amend
  # Commit and open the interactive editor
  cmi = !git add -A && git commit 
  # Rebase onto branch
  rb = rebase 
  rbi = rebase -i 
  rba = rebase --abort
  # Merge branch into, preserving branch history
  mb = merge --no-ff --log 
  mba = merge --abort
  # Delete branch
  delb = branch -d 
  # Tag branch with message = name
  tagb = tag -a -m ""

  # COLLABORATE
  sync = !git pull --rebase && git push
  syncfork = !git checkout master && git pull upstream/master && git push origin/master
  # Open and browse the remote repository's URL
  browse = "!f(){ URL=$(git config remote.origin.url); open ${URL%.git}; }; f"