53
Ten Commandments Of A Software Engineer Sebastian Marek, Internal Systems Technical Architect PHP UK CONFERENCE 2013

Ten Commandments Of A Software Engineer

Embed Size (px)

DESCRIPTION

Software engineering is not an easy profession. You have to constantly learn new things to improve your coding skills and make sure you produce better and cleaner code over time. It’s not difficult, but you have to be aware of a few basic principles. With them in mind you will feel a better engineer and will gain respect from your fellow engineers. And the Lord said: “Thou shall always remember to write unit tests - no matter the deadline. Remember to keep the build green. Thou shall commit often and with meaningful messages (...)”

Citation preview

Page 1: Ten Commandments Of A Software Engineer

Ten Commandments Of A Software Engineer

Sebastian Marek, Internal Systems Technical Architect

PHP UKCONFERENCE 2013

Page 2: Ten Commandments Of A Software Engineer

✴ a Pole living in Sheffield

✴ over 12 years in development

✴ Pascal, C++, PHP, perl, python, Java

✴ co-author of 2 PHP Books

✴ big fan of process automation

✴ TDD and CI

✴ occasionally contributes to open-source projects

✴ wants to be a knight

@proofek

h"ps://joind.in/8050

Page 3: Ten Commandments Of A Software Engineer
Page 4: Ten Commandments Of A Software Engineer
Page 5: Ten Commandments Of A Software Engineer

http://www.flickr.com/photos/archeon/8107633765

Page 6: Ten Commandments Of A Software Engineer

Couple that work for me

http://www.reverendfun.com/?date=20010207

Page 7: Ten Commandments Of A Software Engineer

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Page 8: Ten Commandments Of A Software Engineer

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Page 9: Ten Commandments Of A Software Engineer

“I.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  disrupt����������� ������������������  the����������� ������������������  legacy����������� ������������������  system”

Page 10: Ten Commandments Of A Software Engineer

✴ obsolete technology

✴ business critical

✴ poorly documented

✴ change risk

✴ costly maintenance

Problem:

http://www.flickr.com/photos/tomswift/4253985734/

Page 11: Ten Commandments Of A Software Engineer

✴ extraction

✴ refactoring

✴ blackbox

✴ well defined interface

Solution:

h"p://www.flickr.com/photos/youraccount/3939769126

Page 12: Ten Commandments Of A Software Engineer

“II.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  document����������� ������������������  early����������� ������������������  and����������� ������������������  

while����������� ������������������  thy����������� ������������������  mind����������� ������������������  is����������� ������������������  fresh”

Page 13: Ten Commandments Of A Software Engineer

✴ document from the beginning of the project

✴ developer’s documentation

✴ end-user documentation

✓ automated documentation

✓ real world examples

✓ hints and tips

✓ internal

✓ external

h"p://www.flickr.com/photos/jannem/510243975/

Page 14: Ten Commandments Of A Software Engineer

“III.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  speak����������� ������������������  up����������� ������������������  early����������� ������������������  and����������� ������������������  often”

Page 15: Ten Commandments Of A Software Engineer

✴ effective communication within team

✴ effective communication within business

✴ no decisions vs. bad decisions

✓ communication channels

✓ open and honest

✓ provide options

✓ trust

✓ weak and strong points

h"p://www.flickr.com/photos/redspike/5622332401/

Page 16: Ten Commandments Of A Software Engineer

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Page 17: Ten Commandments Of A Software Engineer

“IV.����������� ������������������  Designeth����������� ������������������  not����������� ������������������  for����������� ������������������  complexity,����������� ������������������  but����������� ������������������  for����������� ������������������  simplicity;����������� ������������������  and����������� ������������������  

wherever����������� ������������������  the����������� ������������������  Beast����������� ������������������  named����������� ������������������  Complex����������� ������������������  shall����������� ������������������  rear����������� ������������������  its����������� ������������������  ugly����������� ������������������  head,����������� ������������������  

smiteth����������� ������������������  it����������� ������������������  with����������� ������������������  thy����������� ������������������  Sword����������� ������������������  named����������� ������������������  Modular,����������� ������������������  and����������� ������������������  let����������� ������������������  no����������� ������������������  Module����������� ������������������  be����������� ������������������  known����������� ������������������  by����������� ������������������  the����������� ������������������  Name����������� ������������������  of����������� ������������������  the����������� ������������������  Beast.”

Page 18: Ten Commandments Of A Software Engineer

✴ the curse of over-engineering

✴ convention over configuration design paradigm

✴ complex problems are best solved using simple solutions

h"p://www.flickr.com

/pho

tos/kelp/4894023263

h"p://www.flickr.com

/pho

tos/kelp/4894889826

Page 19: Ten Commandments Of A Software Engineer

“Make����������� ������������������  everything����������� ������������������  as����������� ������������������  simple����������� ������������������  as����������� ������������������  possible,����������� ������������������  but����������� ������������������  not����������� ������������������  simpler”

h"p://commons.wikimedia.org/wiki/Image:Albert_Einstein_Head.jpg

Page 20: Ten Commandments Of A Software Engineer

“V.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  re-invent����������� ������������������  the����������� ������������������  wheel”

Page 21: Ten Commandments Of A Software Engineer

✴ repeatable operations

✴ in-house frameworks

✴ open-source frameworks

✴ training and support costs

h"p://www.flickr.com/photos/raoulpop/2280399565/

Page 22: Ten Commandments Of A Software Engineer

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Page 23: Ten Commandments Of A Software Engineer

“VI.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  commit����������� ������������������  often����������� ������������������  and����������� ������������������  

your����������� ������������������  messages����������� ������������������  shalt����������� ������������������  be����������� ������������������  informative”

Page 24: Ten Commandments Of A Software Engineer

✴ right tool for the job

✴ commit frequency

✴ commit verbosity

h"p://www.flickr.com/photos/27594459@N04/5941708682/

Page 25: Ten Commandments Of A Software Engineer

Meaningless commit messages

Page 26: Ten Commandments Of A Software Engineer

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <[email protected]>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

Page 27: Ten Commandments Of A Software Engineer

commit 38b22c0b4ed15ddf003d6e1d7fb879349a867957Author: Other Stuff Guy <[email protected]>Date: Mon Nov 22 16:26:27 2010 +0000

Changes to cancel other code

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <[email protected]>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

Page 28: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Verbose Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Expand on comment

commit 38b22c0b4ed15ddf003d6e1d7fb879349a867957Author: Other Stuff Guy <[email protected]>Date: Mon Nov 22 16:26:27 2010 +0000

Changes to cancel other code

commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <[email protected]>Date: Thu Nov 18 16:16:19 2010 +0000

Initial commit of the entire client application

Meaningless commit messages

Page 29: Ten Commandments Of A Software Engineer

Useless commit messages

Page 30: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

Useless commit messages

Page 31: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

commit a69657b2045f1105cc940b67bab4b80b0e07ebe9Author: Did Tests Guy <[email protected]>Date: Tue Mar 22 15:29:03 2011 +0000

Unit tests to prove the fix

Useless commit messages

Page 32: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed

commit a69657b2045f1105cc940b67bab4b80b0e07ebe9Author: Did Tests Guy <[email protected]>Date: Tue Mar 22 15:29:03 2011 +0000

Unit tests to prove the fix

commit af1e80d98c9d8b6fe40efd3eadc27a9d4b1a2420Author: Failed Codereview Guy <[email protected]>Date: Wed Nov 24 17:07:16 2010 +0000

Code review changes, rename file

Useless commit messages

Page 33: Ten Commandments Of A Software Engineer

Informative commit messages

Page 34: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: ProperComment Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed <TicketID>: Scheduled changes cancelled without cancelling engineering appointment

Do not let scheduled changes to be cancelled without calling in, as there is an appointment that needs to be cancelled

Informative commit messages

Page 35: Ten Commandments Of A Software Engineer

commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: ProperComment Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000

Fixed <TicketID>: Scheduled changes cancelled without cancelling engineering appointment

Do not let scheduled changes to be cancelled without calling in, as there is an appointment that needs to be cancelled

commit af1e80d98c9d8b6fe40efd3eadc27a9d4b1a2420Author: ProperComment Guy <[email protected]>Date: Wed Nov 24 17:07:16 2010 +0000

Fixed <TicketID>: Missing data in migration email

Added the extra variables in the email needed for a customer migrating from <a product>

Informative commit messages

Page 36: Ten Commandments Of A Software Engineer

“VII.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  kill����������� ������������������  (maintainability)”

Page 37: Ten Commandments Of A Software Engineer

✴ coding standards that everybody follows

✴ keep your code under control

✴ remove dead code

✓ size

✓ complexity

h"p://www.flickr.com/photos/brykmantra/76765412

Page 38: Ten Commandments Of A Software Engineer

“VIII.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  not����������� ������������������  repeat����������� ������������������  yourself”

Page 39: Ten Commandments Of A Software Engineer

✴ copy/paste temptation

✴ clones mutation

✴ extract and reuse ASAP

✴ tools that support clone detection

h"p://www.flickr.com/photos/via/6182784051/

Page 40: Ten Commandments Of A Software Engineer

Project cycle phases

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Page 41: Ten Commandments Of A Software Engineer

“IX.����������� ������������������  Fear����������� ������������������  not����������� ������������������  the����������� ������������������  Priests����������� ������������������  of����������� ������������������  Quality����������� ������������������  Assurance����������� ������������������  nor����������� ������������������  the����������� ������������������  Altar����������� ������������������  of����������� ������������������  Testability,����������� ������������������  

though����������� ������������������  they����������� ������������������  be����������� ������������������  stained����������� ������������������  with����������� ������������������  the����������� ������������������  blood����������� ������������������  of����������� ������������������  thy����������� ������������������  brethren;����������� ������������������  

for����������� ������������������  they����������� ������������������  are����������� ������������������  the����������� ������������������  Salvation����������� ������������������  of����������� ������������������  the����������� ������������������  Righteous,����������� ������������������  and����������� ������������������  the����������� ������������������  Servants����������� ������������������  of����������� ������������������  our����������� ������������������  Lord,����������� ������������������  the����������� ������������������  Customer.”

Page 42: Ten Commandments Of A Software Engineer

✴ manual testing vs. automated

✴ unit tests

✴ functional tests

✴ frequent and early integration

✴ setup CI server

✴ fix bugs ASAP

✴ take ownership

h"p://www.flickr.com/photos/alisdair/135306281

Page 43: Ten Commandments Of A Software Engineer
Page 44: Ten Commandments Of A Software Engineer

Project(ini+a+on(

Design(

(

Implementa+on(

QA(

Closure(

Project cycle phases

Page 45: Ten Commandments Of A Software Engineer

“X.����������� ������������������  Thou����������� ������������������  shalt����������� ������������������  recognize����������� ������������������  and����������� ������������������  retain����������� ������������������  your����������� ������������������  top����������� ������������������  talent”

Page 46: Ten Commandments Of A Software Engineer

✴ non fungible people

✴ experience + talent

✴ retention policy

✴ “hit by a bus” vs. “upset and unhappy”

✴ people gardening - fertilizers vs. weed control

h"p://www.flickr.com/photos/javacolleen/2897180413/

Page 47: Ten Commandments Of A Software Engineer

The 10 commandments of a Software EngineerI. Thou shalt not disrupt the legacy system

II. Thou shalt document early and while thy mind is fresh

III. Thou shalt speak up early and often

IV. Designeth not for complexity, but for simplicity ...

V. Thou shalt not re-invent the wheel

VI. Thou shalt commit often and your messages shalt be informative

VII. Thou shalt not kill (maintainability)

VIII. Thou shalt not repeat yourself

IX. Fear not the Priests of Quality Assurance ...

X. Thou shalt recognize and retain your top talent

Page 48: Ten Commandments Of A Software Engineer
Page 49: Ten Commandments Of A Software Engineer
Page 50: Ten Commandments Of A Software Engineer
Page 51: Ten Commandments Of A Software Engineer

Further reading

✴ The Ten Commanndments of Software Engineering✓ http://bit.ly/IgHZTu

✴ The Ten Commandments of Software Quality✓ http://bit.ly/yJfatp

✴ The Ten Commandments of Egoless Programming✓ http://bit.ly/atT1F9

✴ http://www.commitlogsfromlastnight.com/

Page 52: Ten Commandments Of A Software Engineer

Robert C. Martin@unclebobmartin

✴ http://cleancoder.posterous.com/

✴ http://blog.8thlight.com/

✴ http://cleancoders.com/

✴ http://manifesto.softwarecraftsmanship.org/

✴ http://katas.softwarecraftsmanship.org/

Software craftsmanship

Page 53: Ten Commandments Of A Software Engineer

h"p://www.flickr.com/photos/the-­‐g-­‐uk/7221928760

Q&Ah"ps://joind.in/8050