58
Software Craftsmanship Kev McCabe ColdFusion Summit 2014 Thursday 16th October http://bigmadkev.com/resources

Software craftsmanship

Embed Size (px)

DESCRIPTION

Software Craftsmanship

Citation preview

Page 1: Software craftsmanship

Software  Craftsmanship

Kev  McCabe  ColdFusion  Summit  2014  Thursday    16th  Octoberhttp://bigmadkev.com/resources

Page 2: Software craftsmanship
Page 3: Software craftsmanship

http://bigmadkev.com/resources

About  Me

Software  Craftsmanship  Mentor  @  General  Electric    • ColdFusion  since  1996  (v2)  • London  CFML  &  Web  

Community  Leader  • Scrum  Master  • Kanban  Practitioner  • Agile  Coach

T:      @bigmadkev  W:  BigMadKev.com

3

Page 4: Software craftsmanship

http://bigmadkev.com/resources

My  Inspiration

Page 5: Software craftsmanship

http://bigmadkev.com/resources

Agile  Software  Development

Individuals and interactions over processes and tools

!Working software over

comprehensive documentation !Customer collaboration over

contract negotiation !Responding to change over

following a plan

Page 6: Software craftsmanship

http://bigmadkev.com/resources

We  adopted  Agile  and  now  things  will  be  OK  !

!

…  and  the  Agile  Transformation  Era  began.

Page 7: Software craftsmanship

http://bigmadkev.com/resources

&  then  we  spend  10  year  focusing  on...

…  people,  interactions,  team  building,  the  ecosystem  

!Process  and  Interactions  became  more  important  than  technical  practices

Page 8: Software craftsmanship

http://bigmadkev.com/resources

The  Agile  Hangover

Many  Agile  projects  are  now,  steadily  and  iteratively,  producing  shit  crap  mediocre  software.

Page 9: Software craftsmanship

http://bigmadkev.com/resources

We  want  to  get  things  done...  !

…  but  we  are  under  pressure

Page 10: Software craftsmanship

http://bigmadkev.com/resources

But  what  is  to  be  Agile  anyway?

Page 11: Software craftsmanship

http://bigmadkev.com/resources

Agile Software Development

!We are uncovering better ways of developing software by doing it

and helping others do it. Through this work we have come to value:

!Individuals and interactions over processes and

tools Working software over comprehensive documentationCustomer collaboration over contract negotiation

Responding to change over following a plan !

That is, while there is value in the items onthe right, we value the items on the left more.

Page 12: Software craftsmanship

http://bigmadkev.com/resources

The  invisible  threat

Code quality

Time per feature

Page 13: Software craftsmanship

http://bigmadkev.com/resourcesManifesto for Software Craftsmanshipraising the bar

As aspiring Software Craftsmen we are raising the bar of professional software development by practising it and helping others learn the craft.

Through this work we have come to value:

Not only working software, but also well-crafted software

Not only responding to change, but also steadily adding value

Not only individuals and interactions, but also a community of professionals

Not only customer collaboration, but also productive partnerships

Page 14: Software craftsmanship

http://bigmadkev.com/resources

What  is  Software  Craftsmanship?

   Software  Craftsmanship  is  all  about  putting  responsibility,  professionalism,  pragmatism  and  pride  back  into  software  development

Page 15: Software craftsmanship

http://bigmadkev.com/resources

!

How  do  we  know  we  are  building  the  right  thing?    !

How  do  we  know  we  are  building  the  thing  right?

Page 16: Software craftsmanship

http://bigmadkev.com/resources

Page 17: Software craftsmanship

http://bigmadkev.com/resources

Adding  value  through  practice

●  Automated  testing  ●  Test  first  ●  Test-­‐Driven  Development    ●  Pair-­‐programming  ●  Continuous  Integration

Page 18: Software craftsmanship

http://bigmadkev.com/resources

Mob  Programming

Page 19: Software craftsmanship

http://bigmadkev.com/resources

Mastering  the  practices  is  hard  …    !

…  and  that's  why  we  practice

Page 20: Software craftsmanship

http://bigmadkev.com/resources

Perfect  practice  (narrowing  the  gap)

Page 21: Software craftsmanship

http://bigmadkev.com/resources

Software  Craftsmanship  is  a  long  journey  to  mastery

Page 22: Software craftsmanship

http://bigmadkev.com/resources

Software  Craftsmanship  Attitude

-­‐  Owning  your  career  -­‐  Not  a  9  to  5  profession  

-­‐  Practice  -­‐  Boy  Scout  rule  -­‐  Expecting  promotions

Page 23: Software craftsmanship

http://bigmadkev.com/resources

Keep  Learning

Learn  stuff  all  the  time  !Small  and  often  !You  don’t  want  to  be  out  of  work  and  having  a  large  learn  curve  !Learning  is  remembering  what  is  important

Page 24: Software craftsmanship

http://bigmadkev.com/resources

Big  Learning  Curve

Page 25: Software craftsmanship

http://bigmadkev.com/resources

Small  and  Often

Page 26: Software craftsmanship

http://bigmadkev.com/resources

Seniority  is  subjective  and  transient

Page 27: Software craftsmanship

http://bigmadkev.com/resources

People  Liquidity

Assign  your  less  experienced  people  first  !Don’t  be  an  i    !be  a  T    !or  even  better  a  M

27

Page 28: Software craftsmanship

http://bigmadkev.com/resources

The  attitude  towards  legacy  code

Page 29: Software craftsmanship

http://bigmadkev.com/resources

Why  would  we  want  to  be  better  developers?

Page 30: Software craftsmanship

http://bigmadkev.com/resources

Software  Craftsmanship  is  not...

…  a  church,  trying  to  convert  all  developers  

It's  about  leading  by  example  and  showing  how  we  can  be  better  

…  about  beautiful  code  

It's  about  continuously  delivering  value  not  writing  crap  code

Page 31: Software craftsmanship

http://bigmadkev.com/resources

!

Raising  the  Bar

Page 32: Software craftsmanship

http://bigmadkev.com/resources

Stop...  !

▪ …  being  miserable  and  negative  ▪ …  spreading  your  frustrations  

Page 33: Software craftsmanship

http://bigmadkev.com/resources

The  only  way  to  have  people  buying  into  what  you  believe  is  if  they  see  you  happy.

Page 34: Software craftsmanship

http://bigmadkev.com/resources

Craftsmanship  is  not  enough  to  guarantee  the  success  of  a  project  but  the  lack  of  it  can  be  the  main  cause  of  its  failure

Page 35: Software craftsmanship

http://bigmadkev.com/resources

Agile  and  Craftsmanship  complement  each  other  and  both  are  necessary.  !Agile  processes  assume  technical  excellence  and  a  professional  attitude.  !Software  Craftsmanship  takes  technical  excellence  and  professionalism  to  a  whole  new  level.

Page 36: Software craftsmanship

http://bigmadkev.com/resources

Clean  Code

Meaningful  Names  Short  Functions  ▪ Single  Responsibility  Principal  ▪ Minimal  Arguments  Show  intent  ▪ No  need  for  comments  Formatting  Unit  Testing

Page 37: Software craftsmanship

http://bigmadkev.com/resources

Unit  Testing

Page 38: Software craftsmanship

http://bigmadkev.com/resources

Code  Reviews

Page 39: Software craftsmanship
Page 40: Software craftsmanship

http://bigmadkev.com/resources

Code  Layout  Matters

Easy  to  scan  Expressive  layout  Compact  format  

Code  is  written  once  and  Read  ∞

Page 41: Software craftsmanship

http://bigmadkev.com/resourcesThe  Elements  of   Programming  Style

1st  edition  1974  2nd  edition  1978  !56  lessons  Most  of  which  are  still  valid  today  !Book  costs  $150+

Page 42: Software craftsmanship

http://bigmadkev.com/resources

Page 43: Software craftsmanship

http://bigmadkev.com/resources

Some  of  the  rules  valid  today

1. Write  clearly  -­‐-­‐  don't  be  too  clever.  2. Say  what  you  mean,  simply  and  directly.  3. Write  clearly  -­‐-­‐  don't  sacrifice  clarity  for  

efficiency.  4. Replace  repetitive  expressions  by  calls  

to  common  functions.  5. Parenthesize  to  avoid  ambiguity.  6. Choose  variable  names  that  won't  be  

confused.  7. Write  first  in  easy-­‐to-­‐understand  pseudo  

language;  then  translate  into  whatever  language  you  have  to  use.  

8. Modularize.  Use  procedures  and  functions.  

9. Don't  patch  bad  code  -­‐-­‐  rewrite  it.  10. Write  and  test  a  big  program  in  small  

pieces.  11. Check  some  answers  by  hand

11. Make  it  right  before  you  make  it  faster.  12. Make  it  fail-­‐safe  before  you  make  it  

faster.  13. Make  it  clear  before  you  make  it  faster.  14. Don't  sacrifice  clarity  for  small  gains  in  

efficiency.  15. Don't  strain  to  re-­‐use  code;  reorganize  

instead.  16. Make  sure  special  cases  are  truly  

special.  17. Keep  it  simple  to  make  it  faster.  18. Don't  just  echo  the  code  with  

comments  -­‐-­‐  make  every  comment  count.  

19. Don't  comment  bad  code  -­‐-­‐  rewrite  it.  20. Use  variable  names  that  mean  

something.  21. Format  a  program  to  help  the  reader  

understand  it.  22. Don't  over-­‐comment.

Page 44: Software craftsmanship

http://bigmadkev.com/resources

INTUITIVE

SOLID  principles  Coupling  and  cohesion  Abstractions  in  code;  Details  in  data  Design  patterns  Presenter-­‐  or  Controller-­‐first  Design

MECHANICAL

Four  Elements  of  Simple  Design  Test-­‐Driven  Development  No  integrated  tests  for  basic  correctness  Check  one  thing  at  a  time  Start  with  what  you  want  to  check  Inject  dependencies  through  the  constructor

http://www.jbrains.ca/permalink/the-­‐four-­‐elements-­‐of-­‐simple-­‐design  J.  B.  Rainsberger

Page 45: Software craftsmanship

http://bigmadkev.com/resources

Four  Elements  of  Simple  Design

▪ Passes  its  tests  !

▪ Minimizes  duplication  !

▪ Maximizes  clarity  !

▪ Has  fewer  elements

Page 46: Software craftsmanship

http://bigmadkev.com/resources

BDD  &  TDD  with  Lego

My  workshop  session  tomorrow  !2:45  pm  -­‐  3:45  pm  !Room:  Bristlecone  9  !No  experience  needed,  open  for  non  devs!

46

Page 47: Software craftsmanship

http://bigmadkev.com/resources

Did  I  mention  Lego?

47

Page 48: Software craftsmanship

http://bigmadkev.com/resources

Page 49: Software craftsmanship
Page 50: Software craftsmanship

http://bigmadkev.com/resources

Books

Written  By  Sandro  !Part  of  the  Robert  C.  Martin  Series  (Uncle  Bob)  !Out  Just  before  Christmas  !ISBN-­‐10:  0134052501

Page 51: Software craftsmanship

http://bigmadkev.com/resources

Clean  Code  !Robert  “Uncle  Bob”  Martin  !Changes  your  thought  process  !+  Videos  !Also  Clean  Coders  –  More  about  your  career

Page 52: Software craftsmanship

http://bigmadkev.com/resources

Extreme  Programming  Explained:  Embrace  Change  !Kent  Back  !Good  Technical  Practices

Page 53: Software craftsmanship

http://bigmadkev.com/resources

Working  Effectively  with  Legacy  Code  !Michael  Feathers

Page 54: Software craftsmanship

http://bigmadkev.com/resources

CFML  Software  Craftsmanship

Google  group  !http://cfml-­‐craftsmanship.com  !Come  Join  Talk  Craftsmanship  !2  Online  Video  discussions  a  month  2nd  Thursday:  US  Centric  -­‐  3pm  PST  6pm  EST  11pm  UK  

4th  Thursday:  Euro  Centric  -­‐  9am  PDT  12pm  EST  5pm  UK

Page 55: Software craftsmanship

http://bigmadkev.com/resources

Questions

Page 56: Software craftsmanship

http://bigmadkev.com/resources

Your  Career

You  own  It!  !

You  got  to  work  for  it  !

You  can  never  stop

Page 57: Software craftsmanship

http://bigmadkev.com/resources

Contact  Me

Happy  to  work  with  people  over    Google  hangout  /  Skype  /  Saros  After  5pm  UK  (12pm  EST  /  9am  PST)FREE  /  Amazon  Wish  list  ☺

T:      @bigmadkev S:      bigmadkev W:  BigMadKev.com

Page 58: Software craftsmanship

http://bigmadkev.com/resources

Survey

Don’t  forget  to  fill  in  your  survey  on  the  mobile  application.  !Only  if  you  liked  me  session  though  :)