Productive programmer reading notes

Written by Keith McDonnell. Last updated on Wednesday, June 06, 2012.

= Acceleration

application launchers, eg alt-f2
search rather than browsing
clipboard manager
shell history
text editor keyboard shortcuts
text editor super abbreviations
text editor macros
Spend a little time each day to become more productive

= Focus

kill all distractions
create quite time


Use open source tools
Cache dev dox locally
Use RSS instead of browsing
Use rake, eg lauch apps for a presentation
Use selenium for repetitive web tasks, ie step 4 of a wizard

Use bash to harvest exception counts:

for X in $(egrep -o “[A-Z]\w*Exception” log_week.txt | sort | uniq) ;

Performing simple, repetitive tasks squanders your concentration.

SQL splitter:

SQL_FILE = “./GeneratedTestData.sql”
OUTPUT_PATH = “./chunks of sql/”
line_num = 1
file_num = 0
Dir.mkdir(OUTPUT_PATH) unless File.exists? OUTPUT_PATH
file = + "chunk " + file_num.to_s + “.sql”,
File::CREAT|File::TRUNC|File::RDWR, 0644)
done, seen_1k_lines = false

IO.readlines(SQL_FILE).each do |line|

This little Ruby program reads lines from the original source file until it has read 1,000 lines.
Then, it starts looking for lines that have either GO or END on them. Once it finds either of
those two strings, it finishes off the current file and starts another one.

Would take 10 mins by hand and 1 hour to automate.

Justifying automation is about return on investment and risk mitigation.

Timebox speculative development & dont shave yaks!

= Canonicality

Sync jEdit macros (github)
Use VM for OS setup / states
Use a wiki for up to date info/doc

= Practice

Use source analysis tools, eg reek, flog
Maximize work on essential complexity; kill accidental complexity.

Law of Demeter says that for any object and method, the only methods
that should be invoked are the following:
• The methods of the object itself
• Parameters of the method
• Any objects created within the method

2006 OOPSLA Anti-objects:

The “obvious” solution to the Pac Man problem builds intelligence into the ghosts.
Yet, the much simpler solution builds the intelligence into the maze (cell smells).
That is the anti-object approach: flip the computational foreground and background.

Composed method FTW

SLAP (single level of abstraction):

you shouldn’t have a method in which part of it deals with low-level database
connectivity, another part with high-level business code, and another with web service

Learn your editor inside & out (pip for jEdit)

If you'd like to discuss this article, you can send me an email and/or publish an article online and link back to this page.