SlideShare uma empresa Scribd logo
1 de 119
Baixar para ler offline
ThoughtWorks




the productive programer:
                mechanics
                  NEAL FORD        software architect / meme wrangler



                            ThoughtWorks
               nford@thoughtworks.com
               3003 Summit Boulevard, Atlanta, GA 30319
               www.nealford.com
               www.thoughtworks.com
               memeagora.blogspot.com
ThoughtWorks
where did this topic
   come from?

          ?
where did this topic
   come from?
where did this topic
   come from?
what i cover:
acceleration
   doing stuff faster
focus
   killing distractions
automation
   getting your computer to work harder
canonicality
   applying the dry principle
acceleration
typing is faster than navigation
o/s accelerators
windows explorer address bar (alt-d)

finder (apple-shift-g)

firefox

  / searching

  number-fox plugin
X
leopard smart help
clipboards
why do operating systems have only 1
clipboard with 1 entry????

clcl

iClip ($$)
                X
jump cut
context switching eats time
there and back
   pushd pushes a directory on the stack

   popd pops it back off
C:temp>pushd MyDocumentsDocumentsdevhaskell

C:MyDocumentsDocumentsdevhaskell>dir
02/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:MyDocumentsDocumentsdevhaskell>popd
command prompts
graphical explorers better for some things....

...command line better for others


command prompt here power toy

bash here (cygwin)
command prompt
  explorer bar
X
path finder
how many of you have
written an application for
 heads-down data entry
       personnel?
when coding, always prefer
   keyboard to mouse
learning shortcuts
make yourself use the shortcut even if you’ve
gotten there another way

have someone/something pester you about it

   pair programmer

   key promoter plug-in for intellij

   key promoter for eclipse (mousefeed)
learning shortcuts

repeat them to yourself


flash cards
all our
hierarchies
are too deep:



 
file system

 
packages
goto class
goto class: pattern of
   capital letters
introduce variable
escalating
selection
some choice shortcuts
                          intelliJ         eclipse
goto class                 ctrl-n         ctrl-shift-t
introduce variable        ctrl-alt-v       alt-shift-l
escalating selection        ctrl-w        alt-shift-up
recently edited files        ctrl-e        n/a (ctrl-e)
symbol list            alt-ctrl-shift-n      ctrl-o
incremental search          alt-f3            ctrl-j
live templates
all major ide’s and coding text editors

parameter substitution, default values, repeating
values

learn the language of your template engine

   velocity in intellij

   bash for textmate/e editor
i   t
n   e
t   m
e   p
l   l
l   a
i   t
j   e
    s
every time you type
something for the 3rd time,
      templatize it
key macro tools
live templates at the o/s level

auto-hot key

textexpander
                   X
typinator
don’t type the same
commands over and over
focus
simple stuff
get a comfortable chair!

dual monitors...

...sitting immediately in front of you

administrator privilege for the o/s

good keyboard
insidious distractions
modern office environments are terrible for
knowledge workers

too much out of context noise

how many people here work in...
war rooms
locus of attention
in the humane interface, jef raskin describes locus
of attention
anything that happens outside your locus of
attention breaks flow
in flow, michael csikszentmihalyi describes flow
state

total concentration

time disappears
killing balloon tips
screen dimmers
automatically makes your background dark
after a set time


jedi concentrate


             X
doodim
the higher the level of
concentration, the denser
         the ideas
the easy stuff
turn off notifications

don’t keep email open

turn off instant messaging

put on headphones

create office “quiet time”
focus techniques
search > navigation
all developer hierarchies are too deep

   file system

   package/namespace

   documentation

what worked well with 20 mb hard drives fails
with 200 gb
desktop search
built into modern operating systems

retro-fittable in older ones

google desktop search

larry’s “any text file” indexer
replace file hierarchy
navigation with search
find + grep

from *-nix & cygwin


       searches for files within a hierarchy
find




       searchs for strings from input or files
grep
from the current
   directory
                   pipe through
                       xargs      matching this text




                        grep with filenames
                          & line numbers
     matching files
     named *.java
chain together conditions




                                             terminate
execute the following on                      the exec
    all matched files                         command
                           placeholder for file name
use “hard target” searches
 to query your code base
what find + grep can’t
       provide
rooted views
specialized explorer view

especially good for directory-based version
control

rooted view == project explorer

create a shortcut:

C:WINDOWSexplorer.exe /e,/root,c:workproject
use virtual desktops
virtual desktops allow you multiple isolated
environments

bind applications to desktops

virtual desktop manager power toy

virtue desktops (in tiger)
                                      X
spaces (in leopard)
canonicality
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
dry o/r
object-relational mapping is one of the most
common dry violations

database schema + xml configuration + pojo > 1

decide on the canonical representation

generate the others
the scenario
         <xml>
           <entity>
            ...
           </entity>
         </xml>


                       class Person {
                           int id;
                           double salary;

                           ...
DDL
                       }




 where’s the information?
canonical
representation
            <xml>
              <entity>
              ...
              </entity>
            </xml>




 DDL    class Person {
            int id;
            double salary;

             ...

        }
the target
build event sql map
generated sql map
step 2: class builder
canonical
representation
            <xml>
              <entity>
              ...
              </entity>
            </xml>




 DDL    class Person {
            int id;
            double salary;

             ...

        }
dry documentation
dry diagrams
dry schemas
the requirement: entity-relationship diagrams
for each iteration

schemaspy

open source schema diagrammer

written in java

generates acceptable html
dry schemas
automation
obvious automatables
one-command build

continuous integration

version control (!)

documentation
don’t build what you don’t
       have to build
buildix
open source project from ThoughtWorks



infrastructure in a box



live cd or ubuntu installation
buildix parts
subversion

cruisecontrol

trac

mingle
“A project dedicated to making code
metrics so widely understood, valuable, and
simple that their use becomes ubiquitous,
thus raising the quality of software across
               the industry.”
panopticode parts
code coverage with emma
   1-line change to switch to cobertura
checkstyle
   1-line switch for custom rule sets

jdepend

javancss

volatility
panopticode parts
code duplication using simian

panopticode aggregator

panopticode reports

treemaps
code coverage tree map
dbDeploy
migrations for the rest of the world

jolt-award winner open source from
ThoughtWorks london

version database schema changes along with
code

builds delta scripts for you
using dbDeploy
someone (dba) creates a sql baseline

developers create delta scripts for each change

dbDeploy compares delta with patch table

generates change scripts

invoked from ant’s sql task
use migrations to manage
database schema changes
subverting other tools
selenium
open source tool for user acceptance testing of
web applications

includes a side-project called selenium ide

allows you to automate debugging “wizard”-
style web applications

you always think “this is the last time”...

...but it never is!
automated interaction
record your interaction the 1st time you walk
through the page

literally cuts hours off debugging time

selenium defines an interaction api for web
applications

have your q/a department record bug
discoveries
don’t spend time doing by
hand what you can automate
build your own tools
you almost never do anything just once

work like a craftsman, not a laborer

build shims & jigs

building a tool takes a little longer than brute
force...

...but you build assets
bash-fu
adding new files to subversion repository

tortoise (on windows), but with limits
svnAddNew
 svn st | grep '^?' | tr '^?' ' ' |
 sed 's/ [ ]*//' | sed 's/[ ]/ /g' | xargs svn add



                    get svn status (new files start with “?”)
svn st

                    find all new files
grep '^?'

                    translate the “?” into a space
tr '^?' ' '

                    substitute spaces to nothing
sed 's/[ ]*//'

                    escape embedded spaces
sed 's/[ ]/ /g'

                    pipe the improved arguments into svn
xargs svn add
more bash-fu
the problem: 2 gb of log files / week

need to know the count of each exception type

by hand?!?

automate with a bash script
get all exception types from log file
                                         sort them




                                            get unique
                                                list
get counts of each
    exception
windows scripting host
windows power shell
powerful replacement for windows scripting
host

uses objects the way *-nix uses plain text

pipe properties from 1 command to another
comparisons
bash

wps



bash


wps
implemented with .net
use .net types within power shell scripts
cmdlets
Get-Command     Retrieves a list of all available cmdlets.

Get-Help        Displays help information about cmdlets and concepts.

Get-WMIObject   Retrieves management information by using WMI.
Get-EventLog    Retrieves Windows event logs.
Get-Process     Retrieves a single or list of active processes.
Get-Service     Retrieves a Windows service.

Get-Content     Reads in text files, treating each line as a child object.

Add-Content     Appends content to a text file.
Copy-Item       Copies an item
Get-Acl         Retrieves access control lists (ACLs).
just one thing...
windows power shell implemented in .net

take advantage of .net types and libraries

.net coupled to every nook & cranny in
windows

“headless” longhorn arriving rsn

won’t have windows power shell!
automating com
scripting rationale

examples in lots of different languages/tools


which one do I use for this problem?


use a real language for scripting
sql splitter
the problem: split a 38,000 line sql file into
1000 line chunks

each chunk must be syntactically correct

“we can do it by hand in 10 minutes...”

automate instead

after 50 minutes:
time spent automating
it took us 5 times longer to automate it

we’ve had to do it numerous times since

it “accidentally” became an important part of
our project

using a real language allowed us to refactor it...

...so that we could write unit tests
using real languages
allow throw-aways to grow into assets


allows unit testing, refactoring, ide support


if you start by treating it as a 1st class problem,
you’ll build better solutions
time savings
solving problems by hand makes you dumber

  steals concentration

  squanders focus

automating makes you smarter

  figure out clever ways to solve problems
justifying automation
timebox
set a reasonable time to see if it’s possible

evaluate at the end of the box

decide if you want to go forward

or create another time box

or abandon the effort
analyze the r.o.i.
how long does it take now X # of times we
must do it?
what are the consequences of doing it wrong 1
time?

automation is about

   time savings

   risk mitigation
don’t shave yaks!
ThoughtWorks




 questions?
   please fill out the session evaluations
slides & samples available at nealford.com


                                                         NEAL FORD        software architect / meme wrangler



                                                                   ThoughtWorks
 This work is licensed under the Creative Commons
                                                      nford@thoughtworks.com
 Attribution-Noncommercial-Share Alike 2.5 License.   3003 Summit Boulevard, Atlanta, GA 30319
                                                      www.nealford.com
                                                      www.thoughtworks.com
  http://creativecommons.org/licenses/by-nc-sa/2.5/   memeagora.blogspot.com
ThoughtWorks




             resources
The Productive Programmer

© 2008, Neal Ford

Published by O’Reilly Media

ISBN: 978-0-596-51978-0

Photos by Candy Ford

Mais conteúdo relacionado

Destaque

Xортикултура Tеодора Aлексић VII2
Xортикултура Tеодора Aлексић VII2Xортикултура Tеодора Aлексић VII2
Xортикултура Tеодора Aлексић VII2
dulovci
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
Thoughtworks
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
Varun Garg
 

Destaque (6)

Xортикултура Tеодора Aлексић VII2
Xортикултура Tеодора Aлексић VII2Xортикултура Tеодора Aлексић VII2
Xортикултура Tеодора Aлексић VII2
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
 
Computer languages 11
Computer languages 11Computer languages 11
Computer languages 11
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 

Semelhante a the productive programer: mechanics

Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Konstantin Sorokin
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
ThoughtWorks Studios
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
Thoughtworks
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko3D
 

Semelhante a the productive programer: mechanics (20)

PyCon 2011: IronPython Command Line
PyCon 2011:  IronPython Command LinePyCon 2011:  IronPython Command Line
PyCon 2011: IronPython Command Line
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
THE BASIC TOOLS
THE BASIC TOOLSTHE BASIC TOOLS
THE BASIC TOOLS
 
10 Ways To Improve Your Code
10 Ways To Improve Your Code10 Ways To Improve Your Code
10 Ways To Improve Your Code
 
Chenli linux-kerne-community
Chenli linux-kerne-communityChenli linux-kerne-community
Chenli linux-kerne-community
 
Modern C++
Modern C++Modern C++
Modern C++
 
R sharing 101
R sharing 101R sharing 101
R sharing 101
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program DevelopmenKostis Sagonas: Cool Tools for Modern Erlang Program Developmen
Kostis Sagonas: Cool Tools for Modern Erlang Program Developmen
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
 
Neal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary ArchitectureNeal Ford Emergent Design And Evolutionary Architecture
Neal Ford Emergent Design And Evolutionary Architecture
 
Functional (web) development with Clojure
Functional (web) development with ClojureFunctional (web) development with Clojure
Functional (web) development with Clojure
 
Google Cluster Innards
Google Cluster InnardsGoogle Cluster Innards
Google Cluster Innards
 
Minko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSLMinko - Targeting Flash/Stage3D with C++ and GLSL
Minko - Targeting Flash/Stage3D with C++ and GLSL
 
DotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NET
 
Skiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in DSkiron - Experiments in CPU Design in D
Skiron - Experiments in CPU Design in D
 
Onyx data processing the clojure way
Onyx   data processing  the clojure wayOnyx   data processing  the clojure way
Onyx data processing the clojure way
 
Activity 5
Activity 5Activity 5
Activity 5
 
.Net Debugging Techniques
.Net Debugging Techniques.Net Debugging Techniques
.Net Debugging Techniques
 
.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques.NET Debugging Tips and Techniques
.NET Debugging Tips and Techniques
 

Mais de elliando dias

Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
elliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
elliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
elliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
elliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
elliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
elliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
elliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
elliando dias
 

Mais de elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

the productive programer: mechanics

  • 1. ThoughtWorks the productive programer: mechanics NEAL FORD software architect / meme wrangler ThoughtWorks nford@thoughtworks.com 3003 Summit Boulevard, Atlanta, GA 30319 www.nealford.com www.thoughtworks.com memeagora.blogspot.com
  • 3. where did this topic come from? ?
  • 4. where did this topic come from?
  • 5. where did this topic come from?
  • 6. what i cover: acceleration doing stuff faster focus killing distractions automation getting your computer to work harder canonicality applying the dry principle
  • 8. typing is faster than navigation
  • 9. o/s accelerators windows explorer address bar (alt-d) finder (apple-shift-g) firefox / searching number-fox plugin
  • 11. clipboards why do operating systems have only 1 clipboard with 1 entry???? clcl iClip ($$) X jump cut
  • 13. there and back pushd pushes a directory on the stack popd pops it back off C:temp>pushd MyDocumentsDocumentsdevhaskell C:MyDocumentsDocumentsdevhaskell>dir 02/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:MyDocumentsDocumentsdevhaskell>popd
  • 14. command prompts graphical explorers better for some things.... ...command line better for others command prompt here power toy bash here (cygwin)
  • 15. command prompt explorer bar
  • 17. how many of you have written an application for heads-down data entry personnel?
  • 18. when coding, always prefer keyboard to mouse
  • 19. learning shortcuts make yourself use the shortcut even if you’ve gotten there another way have someone/something pester you about it pair programmer key promoter plug-in for intellij key promoter for eclipse (mousefeed)
  • 20. learning shortcuts repeat them to yourself flash cards
  • 21. all our hierarchies are too deep: file system packages
  • 23. goto class: pattern of capital letters
  • 26. some choice shortcuts intelliJ eclipse goto class ctrl-n ctrl-shift-t introduce variable ctrl-alt-v alt-shift-l escalating selection ctrl-w alt-shift-up recently edited files ctrl-e n/a (ctrl-e) symbol list alt-ctrl-shift-n ctrl-o incremental search alt-f3 ctrl-j
  • 27. live templates all major ide’s and coding text editors parameter substitution, default values, repeating values learn the language of your template engine velocity in intellij bash for textmate/e editor
  • 28. i t n e t m e p l l l a i t j e s
  • 29. every time you type something for the 3rd time, templatize it
  • 30. key macro tools live templates at the o/s level auto-hot key textexpander X typinator
  • 31. don’t type the same commands over and over
  • 32. focus
  • 33. simple stuff get a comfortable chair! dual monitors... ...sitting immediately in front of you administrator privilege for the o/s good keyboard
  • 34. insidious distractions modern office environments are terrible for knowledge workers too much out of context noise how many people here work in...
  • 36. locus of attention in the humane interface, jef raskin describes locus of attention anything that happens outside your locus of attention breaks flow in flow, michael csikszentmihalyi describes flow state total concentration time disappears
  • 37.
  • 39. screen dimmers automatically makes your background dark after a set time jedi concentrate X doodim
  • 40. the higher the level of concentration, the denser the ideas
  • 41. the easy stuff turn off notifications don’t keep email open turn off instant messaging put on headphones create office “quiet time”
  • 43. search > navigation all developer hierarchies are too deep file system package/namespace documentation what worked well with 20 mb hard drives fails with 200 gb
  • 44. desktop search built into modern operating systems retro-fittable in older ones google desktop search larry’s “any text file” indexer
  • 46. find + grep from *-nix & cygwin searches for files within a hierarchy find searchs for strings from input or files grep
  • 47. from the current directory pipe through xargs matching this text grep with filenames & line numbers matching files named *.java
  • 48. chain together conditions terminate execute the following on the exec all matched files command placeholder for file name
  • 49.
  • 50. use “hard target” searches to query your code base
  • 51. what find + grep can’t provide
  • 52. rooted views specialized explorer view especially good for directory-based version control rooted view == project explorer create a shortcut: C:WINDOWSexplorer.exe /e,/root,c:workproject
  • 53.
  • 54.
  • 55. use virtual desktops virtual desktops allow you multiple isolated environments bind applications to desktops virtual desktop manager power toy virtue desktops (in tiger) X spaces (in leopard)
  • 56.
  • 58. 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
  • 59. dry o/r object-relational mapping is one of the most common dry violations database schema + xml configuration + pojo > 1 decide on the canonical representation generate the others
  • 60. the scenario <xml> <entity> ... </entity> </xml> class Person { int id; double salary; ... DDL } where’s the information?
  • 61. canonical representation <xml> <entity> ... </entity> </xml> DDL class Person { int id; double salary; ... }
  • 64.
  • 65.
  • 67. step 2: class builder
  • 68.
  • 69.
  • 70.
  • 71.
  • 72. canonical representation <xml> <entity> ... </entity> </xml> DDL class Person { int id; double salary; ... }
  • 75. dry schemas the requirement: entity-relationship diagrams for each iteration schemaspy open source schema diagrammer written in java generates acceptable html
  • 78. obvious automatables one-command build continuous integration version control (!) documentation
  • 79. don’t build what you don’t have to build
  • 80. buildix open source project from ThoughtWorks infrastructure in a box live cd or ubuntu installation
  • 82. “A project dedicated to making code metrics so widely understood, valuable, and simple that their use becomes ubiquitous, thus raising the quality of software across the industry.”
  • 83. panopticode parts code coverage with emma 1-line change to switch to cobertura checkstyle 1-line switch for custom rule sets jdepend javancss volatility
  • 84. panopticode parts code duplication using simian panopticode aggregator panopticode reports treemaps
  • 86. dbDeploy migrations for the rest of the world jolt-award winner open source from ThoughtWorks london version database schema changes along with code builds delta scripts for you
  • 87. using dbDeploy someone (dba) creates a sql baseline developers create delta scripts for each change dbDeploy compares delta with patch table generates change scripts invoked from ant’s sql task
  • 88. use migrations to manage database schema changes
  • 90. selenium open source tool for user acceptance testing of web applications includes a side-project called selenium ide allows you to automate debugging “wizard”- style web applications you always think “this is the last time”... ...but it never is!
  • 91.
  • 92. automated interaction record your interaction the 1st time you walk through the page literally cuts hours off debugging time selenium defines an interaction api for web applications have your q/a department record bug discoveries
  • 93. don’t spend time doing by hand what you can automate
  • 94. build your own tools
  • 95. you almost never do anything just once work like a craftsman, not a laborer build shims & jigs building a tool takes a little longer than brute force... ...but you build assets
  • 96. bash-fu adding new files to subversion repository tortoise (on windows), but with limits
  • 97. svnAddNew svn st | grep '^?' | tr '^?' ' ' | sed 's/ [ ]*//' | sed 's/[ ]/ /g' | xargs svn add get svn status (new files start with “?”) svn st find all new files grep '^?' translate the “?” into a space tr '^?' ' ' substitute spaces to nothing sed 's/[ ]*//' escape embedded spaces sed 's/[ ]/ /g' pipe the improved arguments into svn xargs svn add
  • 98. more bash-fu the problem: 2 gb of log files / week need to know the count of each exception type by hand?!? automate with a bash script
  • 99. get all exception types from log file sort them get unique list get counts of each exception
  • 101. windows power shell powerful replacement for windows scripting host uses objects the way *-nix uses plain text pipe properties from 1 command to another
  • 103. implemented with .net use .net types within power shell scripts
  • 104. cmdlets Get-Command Retrieves a list of all available cmdlets. Get-Help Displays help information about cmdlets and concepts. Get-WMIObject Retrieves management information by using WMI. Get-EventLog Retrieves Windows event logs. Get-Process Retrieves a single or list of active processes. Get-Service Retrieves a Windows service. Get-Content Reads in text files, treating each line as a child object. Add-Content Appends content to a text file. Copy-Item Copies an item Get-Acl Retrieves access control lists (ACLs).
  • 105. just one thing... windows power shell implemented in .net take advantage of .net types and libraries .net coupled to every nook & cranny in windows “headless” longhorn arriving rsn won’t have windows power shell!
  • 107. scripting rationale examples in lots of different languages/tools which one do I use for this problem? use a real language for scripting
  • 108. sql splitter the problem: split a 38,000 line sql file into 1000 line chunks each chunk must be syntactically correct “we can do it by hand in 10 minutes...” automate instead after 50 minutes:
  • 109.
  • 110. time spent automating it took us 5 times longer to automate it we’ve had to do it numerous times since it “accidentally” became an important part of our project using a real language allowed us to refactor it... ...so that we could write unit tests
  • 111.
  • 112. using real languages allow throw-aways to grow into assets allows unit testing, refactoring, ide support if you start by treating it as a 1st class problem, you’ll build better solutions
  • 113. time savings solving problems by hand makes you dumber steals concentration squanders focus automating makes you smarter figure out clever ways to solve problems
  • 115. timebox set a reasonable time to see if it’s possible evaluate at the end of the box decide if you want to go forward or create another time box or abandon the effort
  • 116. analyze the r.o.i. how long does it take now X # of times we must do it? what are the consequences of doing it wrong 1 time? automation is about time savings risk mitigation
  • 118. ThoughtWorks questions? please fill out the session evaluations slides & samples available at nealford.com NEAL FORD software architect / meme wrangler ThoughtWorks This work is licensed under the Creative Commons nford@thoughtworks.com Attribution-Noncommercial-Share Alike 2.5 License. 3003 Summit Boulevard, Atlanta, GA 30319 www.nealford.com www.thoughtworks.com http://creativecommons.org/licenses/by-nc-sa/2.5/ memeagora.blogspot.com
  • 119. ThoughtWorks resources The Productive Programmer © 2008, Neal Ford Published by O’Reilly Media ISBN: 978-0-596-51978-0 Photos by Candy Ford