productive programmer tutorial - 33rd degree33degree.org/pdf/nealfordproductiveprogrammer.pdf6. we...
TRANSCRIPT
![Page 1: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/1.jpg)
ThoughtWorksThoughtWorks
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
memeagora.blogspot.com
the productive programmer
![Page 2: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/2.jpg)
where did this topic come from?
?
![Page 3: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/3.jpg)
where did this topic come from?
![Page 4: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/4.jpg)
where did this topic come from?
![Page 5: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/5.jpg)
automationkilling distractions
canonicalityapplying the dry principle
getting your computer to work harder
focusdoing stuff faster
acceleration
part 1: mechanics
![Page 6: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/6.jpg)
acceleration
![Page 7: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/7.jpg)
typing is faster than navigation
![Page 8: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/8.jpg)
firefox
windows explorer address bar (alt-d)
finder (apple-shift-g)
number-fox plugin
/ searching
o/s accelerators
![Page 9: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/9.jpg)
leopard smart help X
![Page 10: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/10.jpg)
iClip ($$)
why do operating systems have only 1 clipboard with 1 entry????
clcl
jump cut
clipboards
X
![Page 11: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/11.jpg)
mac os x : jumpcut demo
![Page 12: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/12.jpg)
context switching eats time
![Page 13: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/13.jpg)
pushd pushes a directory on the stack
popd pops it back off
there and back
C:\temp>pushd \MyDocuments\Documents\dev\haskell
C:\MyDocuments\Documents\dev\haskell>dir02/13/2006 12:12 AM <DIR> .02/13/2006 12:12 AM <DIR> ..02/13/2006 12:12 AM <DIR> nfjs_functionallangs_haskell 0 File(s) 0 bytes 3 Dir(s) 11,743,178,752 bytes free
C:\MyDocuments\Documents\dev\haskell>popd
![Page 14: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/14.jpg)
pushd/popd
![Page 15: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/15.jpg)
command prompt here power toy
graphical explorers better for some things....
...command line better for others
bash here (cygwin)
command prompts
![Page 16: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/16.jpg)
cmd prompt explorer bar
![Page 17: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/17.jpg)
path finder X
![Page 18: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/18.jpg)
how many of you have written an application for heads-down data entry
personnel?
![Page 19: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/19.jpg)
when coding, always prefer keyboard to mouse
![Page 20: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/20.jpg)
pair programmer
make yourself use the shortcut even if you’ve gotten there another way
have someone/something pester you about it
mousefeed for eclipse
key promoter plug-in for intellij
learning shortcuts
![Page 21: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/21.jpg)
![Page 22: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/22.jpg)
repeat them to yourself
flash cards
learning shortcuts
create a “cheat sheet”
![Page 23: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/23.jpg)
all our hierarchies are too deep: file system packages
![Page 24: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/24.jpg)
goto class
![Page 25: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/25.jpg)
goto class: pattern of capital letters
![Page 26: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/26.jpg)
goto symbol
![Page 27: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/27.jpg)
introduce variable
![Page 28: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/28.jpg)
introduce variable redux
![Page 29: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/29.jpg)
escalating selection
![Page 30: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/30.jpg)
some choice shortcuts
intelliJ eclipse
goto class ctrl-n ctrl-shift-t
introduce variable ctrl-alt-v alt-shift-lescalating selection ctrl-w alt-shift-uprecently edited files ctrl-e n/a (ctrl-e)symbol list alt-ctrl-shift-n ctrl-oincremental search alt-f3 ctrl-j
![Page 31: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/31.jpg)
learn the language of your template engine
all major ide’s and coding text editors
parameter substitution, default values, repeating values
bash for textmate/e editor
velocity in intellij
live templates
![Page 32: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/32.jpg)
intellij
templates
![Page 33: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/33.jpg)
every time you type something for the 3rd time,
templatize it
![Page 34: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/34.jpg)
textexpander
live templates at the o/s level
auto-hot key
typinator
key macro tools
X
![Page 35: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/35.jpg)
textexpander
![Page 36: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/36.jpg)
don’t type the same commands over and over
![Page 37: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/37.jpg)
focus
![Page 38: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/38.jpg)
...sitting immediately in front of you
get a comfortable chair!
dual monitors...
good keyboard
administrator privilege for the o/s
simple stuff
![Page 39: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/39.jpg)
how many people here work in cube land?
modern office environments are terrible for knowledge workers
too much out of context noise
insidious distractions
![Page 40: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/40.jpg)
war rooms
![Page 41: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/41.jpg)
in flow, michael csikszentmihalyi describes flow state
in the humane interface, jef raskin describes locus of attention
anything that happens outside your locus of attention breaks flow
time disappears
total concentration
locus of attention
![Page 42: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/42.jpg)
![Page 43: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/43.jpg)
killing balloon tips
![Page 44: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/44.jpg)
automatically makes your background dark after a set time
jedi concentrate
doodim
screen dimmers
X
![Page 45: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/45.jpg)
internet blockers
http://getconcentrating.com/X
http://www.gyrolabs.com/2006/09/25/jediconcentrate-mod/
![Page 46: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/46.jpg)
the higher the level of concentration, the denser
the ideas
![Page 47: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/47.jpg)
turn off instant messaging
turn off notifications
don’t keep email open
create office “quiet time”
put on headphones
the easy stuff
![Page 48: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/48.jpg)
this is not the solution!Puma Productivity
Pants™
![Page 49: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/49.jpg)
focus techniques
![Page 50: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/50.jpg)
package/namespace
all developer hierarchies are too deep
file system
what worked well with 20 mb hard drives fails with 200 gb
documentation
search > navigation
![Page 51: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/51.jpg)
google desktop search
built into modern operating systems
retro-fittable in older ones
larry’s “any text file” indexer
desktop search
![Page 52: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/52.jpg)
![Page 53: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/53.jpg)
replace file hierarchy navigation with search
![Page 54: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/54.jpg)
rooted view == project explorer
specialized explorer view
especially good for directory-based version control
C:\WINDOWS\explorer.exe /e,/root,c:\work\project
create a shortcut:
rooted views
![Page 55: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/55.jpg)
![Page 56: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/56.jpg)
![Page 57: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/57.jpg)
virtual desktop manager power toy
spaces (in leopard)
use virtual desktops
X
http://virtuawin.sourceforge.net/
![Page 58: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/58.jpg)
![Page 59: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/59.jpg)
canonicality
![Page 60: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/60.jpg)
DRY says that every piece of system knowledge should have one authoritative, unambiguous representation. Every piece of knowledge in the development of something should have a
single representation. A system's knowledge is far broader than just its code. It refers to database schemas, test plans, the build
system, even documentation. the pragmatic programmer - andy hunt, dave thomas
![Page 61: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/61.jpg)
decide on the canonical representation
object-relational mapping is one of the most common dry violations
database schema + xml configuration + pojo > 1
generate the others
dry o/r
![Page 62: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/62.jpg)
the scenario
DDL
<xml>
<entity>
...
</entity>
</xml>
class Person {
int id;
double salary;
. . .
}
where’s the information?
![Page 63: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/63.jpg)
canonical representation
DDL
<xml>
<entity>
...
</entity>
</xml>
class Person {
int id;
double salary;
. . .
}
![Page 64: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/64.jpg)
the target
![Page 65: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/65.jpg)
build event sql map
![Page 66: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/66.jpg)
![Page 67: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/67.jpg)
![Page 68: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/68.jpg)
generated sql map
![Page 69: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/69.jpg)
step 2: class builder
![Page 70: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/70.jpg)
![Page 71: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/71.jpg)
![Page 72: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/72.jpg)
![Page 73: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/73.jpg)
![Page 74: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/74.jpg)
canonical representation
DDL
<xml>
<entity>
...
</entity>
</xml>
class Person {
int id;
double salary;
. . .
}
![Page 75: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/75.jpg)
dry documentation
![Page 76: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/76.jpg)
dry diagrams
![Page 77: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/77.jpg)
open source schema diagrammer
the requirement: entity-relationship diagrams for each iteration
schemaspy
generates acceptable html
written in java
dry schemas
![Page 78: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/78.jpg)
dry schemas
![Page 79: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/79.jpg)
automation
![Page 80: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/80.jpg)
version control (!)
one-command build
continuous integration
documentation
obvious automatables
![Page 81: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/81.jpg)
subverting other tools
![Page 82: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/82.jpg)
allows you to automate debugging “wizard”-style web applications
open source tool for user acceptance testing of web applications
includes a side-project called selenium ide
...but it never is!
you always think “this is the last time”...
selenium
![Page 83: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/83.jpg)
![Page 84: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/84.jpg)
![Page 85: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/85.jpg)
![Page 86: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/86.jpg)
![Page 87: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/87.jpg)
![Page 88: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/88.jpg)
selenium defines an interaction api for web applications
record your interaction the 1st time you walk through the page
literally cuts hours off debugging time
have your q/a department record bug discoveries
automated interaction
![Page 89: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/89.jpg)
don’t spend time doing by hand what you can automate
![Page 90: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/90.jpg)
build your own tools
![Page 91: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/91.jpg)
build shims & jigs
you almost never do anything just once
work like a craftsman, not a laborer
...but you build assets
building a tool takes a little longer than brute force...
![Page 92: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/92.jpg)
adding new files to subversion repository
tortoise (on windows), but with limits
bash-fu
![Page 93: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/93.jpg)
svnAddNewsvn st | grep '^\?' | tr '^\?' ' ' | sed 's/ [ ]*//' | sed 's/[ ]/\\ /g' | xargs svn add
svn st get svn status (new files start with “?”)
grep '^\?' find all new files
tr '^\?' ' ' translate the “?” into a space
sed 's/[ ]*//' substitute spaces to nothing
sed 's/[ ]/\\ /g' escape embedded spaces
xargs svn add pipe the improved arguments into svn
![Page 94: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/94.jpg)
by hand?!?
the problem: 2 gb of log files / week
need to know the count of each exception type
automate with a bash script
more bash-fu
![Page 95: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/95.jpg)
get counts of each exception
get all exception types from log file sort them
get unique list
![Page 96: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/96.jpg)
automating com
![Page 97: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/97.jpg)
use a real language for scripting
examples in lots of different languages/tools
which one do I use for this problem?
scripting rationale
![Page 98: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/98.jpg)
“we can do it by hand in 10 minutes...”
the problem: split a 38,000 line sql file into 1000 line chunks
each chunk must be syntactically correct
after 50 minutes:
automate instead
sql splitter
![Page 99: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/99.jpg)
![Page 100: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/100.jpg)
it “accidentally” became an important part of our project
it took us 5 times longer to automate it
we’ve had to do it numerous times since
...so that we could write unit tests
using a real language allowed us to refactor it...
time spent automating
![Page 101: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/101.jpg)
![Page 102: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/102.jpg)
if you start by treating it as a 1st class problem, you’ll build better solutions
allow throw-aways to grow into assets
allows unit testing, refactoring, ide support
using real languages
![Page 103: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/103.jpg)
squanders focus
solving problems by hand makes you dumber
steals concentration
figure out clever ways to solve problems
automating makes you smarter
time savings
![Page 104: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/104.jpg)
justifying automation
![Page 105: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/105.jpg)
decide if you want to go forward
set a reasonable time to see if it’s possible
evaluate at the end of the box
or abandon the effort
or create another time box
timebox
![Page 106: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/106.jpg)
automation is about
how long does it take now X # of times we must do it?
what are the consequences of doing it wrong 1 time?
risk mitigation
time savings
analyze the r.o.i.
![Page 107: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/107.jpg)
don’t shave yaks!
![Page 108: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/108.jpg)
end of part 1:mechanics
next: practice
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
memeagora.blogspot.com
![Page 109: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/109.jpg)
ThoughtWorks
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
memeagora.blogspot.com
10 ways to improve your code
![Page 110: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/110.jpg)
composed method
1
![Page 111: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/111.jpg)
![Page 112: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/112.jpg)
Keep all of the operations in a method at the same level of abstraction.
Divide your program into methods that perform one identifiable task.
This will naturally result in programs with many small methods, each a few lines long.
composed method
![Page 113: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/113.jpg)
refactoring to composed method
![Page 114: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/114.jpg)
![Page 115: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/115.jpg)
![Page 116: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/116.jpg)
populate()
getDatabaseConnection()
createResultSet()
addPartToListFromResultSet()
PartDb
populate()
getDatabaseConnection()
createResultSet()
addPartToListFromResultSet()
PartDb
getDatabaseConnection()
BoundaryBase
populate()
createResultSet()
addPartToListFromResultSet()
PartDb
![Page 117: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/117.jpg)
populate()
createResultSet()
addPartToListFromResultSet()
PartDb
getDatabaseConnection()
BoundaryBase
populate()
createResultSet()
addPartToListFromResultSet()
PartDb
![Page 118: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/118.jpg)
BoundaryBase
PartDb
![Page 119: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/119.jpg)
populate()
getSqlForEntity()addPartToListFromResultSet()
PartDb
getDatabaseConnection()
getSqlForEntity()
createResultSet()
BoundaryBase
![Page 120: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/120.jpg)
![Page 121: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/121.jpg)
![Page 122: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/122.jpg)
addEntityToListFromResultSet()
getSqlForEntity()addPartToListFromResultSet()
PartDb
getDatabaseConnection()
getSqlForEntity()
createResultSet()
addEntityToListFromResultSet()
populate()
BoundaryBase
populate()
getSqlForEntity()addPartToListFromResultSet()
PartDb
getDatabaseConnection()
getSqlForEntity()
createResultSet()
BoundaryBase
![Page 123: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/123.jpg)
BoundaryBase
![Page 124: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/124.jpg)
PartDb
![Page 125: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/125.jpg)
large number of very cohesive methods
shorter methods easier to test
method names become documentation
discover reusable assets that you didn’t know were there
benefits of composed method
![Page 126: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/126.jpg)
test-driven development
test-driven design2
![Page 127: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/127.jpg)
creates consumption awareness
first consumer
think about how the rest of the world uses this class
design benefits of tdd
![Page 128: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/128.jpg)
cleaner metrics
forces mocking of dependent objects
naturally creates composed method
design benefits of tdd
![Page 129: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/129.jpg)
CustomerCustomer
addOrder()
extroverted object
Order
![Page 130: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/130.jpg)
Customer
addOrder(Order o)
Order
introverted object
![Page 131: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/131.jpg)
extroverted objects introverted objects
“reach out” to create objects
ad hoc creation
cleaner dependencies
moves object construction to a few simple places
![Page 132: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/132.jpg)
static analysis
3
![Page 133: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/133.jpg)
byte-code analysis: findbugs
![Page 134: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/134.jpg)
bad practiceviolation of recommended & essential coding practice
correctnessprobable bug
dodgyconfusing, anomalous, written poorly
bug categories
![Page 135: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/135.jpg)
![Page 136: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/136.jpg)
![Page 137: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/137.jpg)
source analysis & pmd
![Page 138: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/138.jpg)
suboptimal code
possible bugs
dead code
overcomplicated expressions
pmd targets
empty try/catch blocks
unused local variablesparameters
private variables
wasteful string usage
![Page 139: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/139.jpg)
running pmd on hibernate (unused
ruleset)
![Page 140: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/140.jpg)
cpd
![Page 141: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/141.jpg)
good citizenship
4
![Page 142: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/142.jpg)
getters & setters != encapsulation
![Page 143: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/143.jpg)
“should I unit test my getters & setters?”
knee-jerk creating getters/setters voids encapsulation
create atomic mutators for dependent fields
accessors/mutators
![Page 144: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/144.jpg)
shouldn’t have to tdd them
only create getters & setters when you need them for other methods
testing:
as easy upon use as upon creation
they will get code coverage automatically
the new strategy
![Page 145: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/145.jpg)
never!
specific contract for how to create valid objects
how often is a blank object valid?
push back on frameworks that require this
don’t provide default constructors for domain objects
constructors
![Page 146: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/146.jpg)
static methods
Math.sqrt(25)
Math.sqrt()
![Page 147: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/147.jpg)
mixes responsibilities
singleton is bad because:
the object version of global variables
untestable
mixing static + state
singleton
![Page 148: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/148.jpg)
testable!
1. create a pojo for the business behavior
simple
also testable
2. create a factory to create the pojo
avoiding singletons
![Page 149: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/149.jpg)
![Page 150: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/150.jpg)
![Page 151: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/151.jpg)
![Page 152: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/152.jpg)
![Page 153: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/153.jpg)
the worst citizen in the java world...
java.util.Calendar
![Page 154: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/154.jpg)
yagni
you ain’t gonna need it5
![Page 155: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/155.jpg)
increases software entropy
build the simplest thing that we need right now
don’t indulge in speculative development
leads to frameworks
only saves time if you can guarantee you won’t have to change it later
discourages gold plating
![Page 156: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/156.jpg)
a public plea to the java community:
please stop building frameworks!
![Page 157: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/157.jpg)
![Page 158: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/158.jpg)
This is just what they need!
![Page 159: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/159.jpg)
![Page 160: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/160.jpg)
a cautionary tale
building a simple framework
![Page 161: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/161.jpg)
changeability
anticipatory design
refactorable
rate of change
higherlower
![Page 162: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/162.jpg)
corporate code smells
![Page 163: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/163.jpg)
6. We have an Architect who reviews all code pre-checkin and decides whether or not to allow it into version control.
7. We can’t use any open source code because our lawyers say we can’t.
8. We use WebSphere because...(I always stop listening at this point)
10. We invented our own web/persistence/messaging/caching framework because none of the existing ones was good enough.
9. We bought the entire tool suite (even though we only needed about 10% of it) because it was cheaper than buying the individual tools.
![Page 164: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/164.jpg)
1. There is a reason that WSAD isn’t called WHAPPY.2. The initial estimate must be within 15% of the final cost, the post-analysis estimate must be within 10%, and the post-design estimate must be with 5%3. We don’t have time to write unit tests (we’re spending too much time debugging)
5. The only JavaDoc is the Eclipse message explaining how to change your default JavaDoc template.
4. We keep all of our business logic in stored procedures...for performance reasons.
![Page 165: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/165.jpg)
question authority6
![Page 166: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/166.jpg)
![Page 167: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/167.jpg)
angry monkeys & christmas roasts
![Page 168: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/168.jpg)
test namestestUpdateCacheAndVerifyThatItemExists() {
}
test_Update_cache_and_verify_that_item_exists() {
}
![Page 169: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/169.jpg)
api’s
![Page 170: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/170.jpg)
fluent interfaces
![Page 171: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/171.jpg)
what stands in the way?
the javabean specification!
![Page 172: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/172.jpg)
harms constructor as specification
forces you to create default constructors
creates bad citizens
can’t use beans for fluent interfaces
setXXX() methods return void
what’s bad about beans?
![Page 173: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/173.jpg)
non-intuitive
![Page 174: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/174.jpg)
![Page 175: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/175.jpg)
pair programming studies
after adjusting, pairs produced code 15% more slowly than individuals...
![Page 176: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/176.jpg)
pair programming studies
...with 15% fewer defects
![Page 177: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/177.jpg)
slap
7 single level of abstraction principle
![Page 178: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/178.jpg)
composed method => slap
keep all lines of code in a method at the same level of abstraction
jumping abstraction layers makes code hard to understand
even if it means single-line methods
refactor to slap
s l a p
![Page 179: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/179.jpg)
![Page 180: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/180.jpg)
![Page 181: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/181.jpg)
polyglot
programming
8
![Page 182: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/182.jpg)
leveraging existing platforms with languages
targeted at specific problems and applications
![Page 183: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/183.jpg)
why do this?
![Page 184: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/184.jpg)
schedule pressure
massively parallel threading
use a functional language: jaskell, scala
jruby on rails, grails
looming problems/opportunities
![Page 185: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/185.jpg)
stop banging rocks together & get some work done!
everyday coding
groovy, ruby
face it:
looming problems/opportunities
groovy EBXL™
![Page 186: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/186.jpg)
writing more declarative code via dsls
build fluent interfaces
looming problems/opportunities
![Page 187: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/187.jpg)
now, language != platform
doesn’t polyglot programming add complexity?
In the past, language == platform
complexity
![Page 188: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/188.jpg)
![Page 189: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/189.jpg)
![Page 190: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/190.jpg)
![Page 191: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/191.jpg)
J
![Page 192: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/192.jpg)
![Page 193: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/193.jpg)
every nuance
9
![Page 194: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/194.jpg)
no longer true
reflection
“reflection is slow”
elegant solutions to problems
java’s back alleys
![Page 195: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/195.jpg)
![Page 196: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/196.jpg)
![Page 197: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/197.jpg)
![Page 198: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/198.jpg)
regular expressions &
![Page 199: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/199.jpg)
![Page 200: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/200.jpg)
learn the nuances of java...
...then tell the other people on your project
![Page 201: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/201.jpg)
anti-objects
10
![Page 202: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/202.jpg)
“The metaphor of objects can go too far by making us try to create objects that are too much inspired by the real world. “
“...an antiobject is a kind of object that appears to essentially do the opposite of what we generally think the object should be doing.”
collaborative diffusion
![Page 203: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/203.jpg)
![Page 204: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/204.jpg)
![Page 205: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/205.jpg)
ThoughtWorks
This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.
http://creativecommons.org/licenses/by-nc-sa/2.5/
questions?
please fill out the session evaluationsslides & samples available at nealford.com
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
memeagora.blogspot.com
![Page 206: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/206.jpg)
An Initial Investigation of Test Driven Development in Industry - Laurie Williams, Boby Georgehttp://collaboration.csc.ncsu.edu/laurie/Papers/TDDpaperv8.pdf
AntiPatterns Cataloghttp://c2.com/cgi/wiki?AntiPatternsCatalog
The legend of the leaning towerhttp://physicsworld.com/cws/article/print/16806
findbugshttp://findbugs.sourceforge.net/
pmd/cpdhttp://pmd.sourceforge.net/
resources
![Page 207: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/207.jpg)
resourcesSmalltalk Best Practice Patterns Kent BeckPrentice Hall PTR (October 13, 1996)ISBN-10: 013476904X
Polyglot Programminghttp://memeagora.blogspot.com/2006/12/polyglot-programming.html
Optical Illusions http://en.wikipedia.org/wiki/Optical_illusion
Collaborative Diffusion: Programming Anti-objects - A Repenninghttp://www.cs.colorado.edu/~ralex/papers/PDF/OOPSLA06antiobjects.pdf
![Page 208: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/208.jpg)
resources
http://www.cs.utah.edu/~lwilliam/Papers/ieeeSoftware.PDF
http://collaboration.csc.ncsu.edu/laurie/Papers/XPSardinia.PDF
http://www.xprogramming.com/Practices/PracPairs.html
http://c2.com/cgi/wiki?PairProgramming
pair programming
![Page 209: Productive Programmer Tutorial - 33rd Degree33degree.org/Pdf/NealFordProductiveProgrammer.pdf6. We have an Architect who reviews all code pre-checkin and decides whether or not to](https://reader034.vdocuments.us/reader034/viewer/2022042206/5ea8fdd48898af63fe47d7e3/html5/thumbnails/209.jpg)
resources
ThoughtWorks
© 2008, Neal Ford
Published by O’Reilly Media
The Productive Programmer
Photos by Candy Ford
ISBN: 978-0-596-51978-0