Upload
sebastian-marek
View
4.097
Download
2
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
Ten CommandmentsOf
A Software Engineer
Sebastian Marek
@proofek
• 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
Couple that works for me…
I. Thou shalt not disrupt the legacy system.
1st commandment
I. Thou shalt not disrupt the legacy system.
Problem:
• Obsolete technology• Business critical• Poorly documented• Change risk vs. costly maintenance
I. Thou shalt not disrupt the legacy system.
Solution:
• extract• blackbox• Hide behind well defined interface
II. Thou shalt not re-invent the wheel.
2nd commandment
II. Thou shalt not re-invent the wheel.
• Repeatable operations• In-house framework vs. open source
framework• Training and support costs
III. Thou shalt commit often and your messages shalt be
informative
3rd commandment
III. Thou shalt commit often and your messages shalt be …
• Right tool for the job• Commit frequency• Commit verbosity
commit 04f1f73b9ad9a2fa968cc3d16701c84f10965e66Author: Generic Guy <[email protected]>Date: Thu Nov 18 16:16:19 2010 +0000
Initial commit of the entire client application
commit 38b22c0b4ed15ddf003d6e1d7fb879349a867957Author: Other Stuff Guy <[email protected]>Date: Mon Nov 22 16:26:27 2010 +0000
Changes to cancel other code
commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Verbose Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000
Expand on comment
Meaningless commit messages
commit af1e80d98c9d8b6fe40efd3eadc27a9d4b1a2420Author: Failed Codereview Guy <[email protected]>Date: Wed Nov 24 17:07:16 2010 +0000
Code review changes, rename file
commit a69657b2045f1105cc940b67bab4b80b0e07ebe9Author: Did Tests Guy <[email protected]>Date: Tue Mar 22 15:29:03 2011 +0000
Unit tests to prove the fix
commit 971704e40b00cbd5fde612ed5aeb96e174bc9d2aAuthor: Fixed Guy <[email protected]>Date: Tue Nov 23 16:30:16 2010 +0000
Fixed
Useless commit messages
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>
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
IV. Thou shalt document early and while thy mind is fresh
4th commandment
IV. Thou shalt document early and while thy mind is fresh
• Document from the beginning of the project• Developer documentation– Automated documentation– Real world examples– Hints and tips
• End user documentation– Internal– external
V. 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.
5th commandment
V. Fear not the Priests of Quality Assurance nor the Altar of …
• Manual testing vs. automated• Unit tests• Functional tests• Frequent and early integration• Setup CI server• Fix bugs ASAP• Take ownership
VI. 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.
6th commandment
VI. Designeth not for complexity, but for simplicity; and wherever…
• The curse of overengineering• Convention over configuration design
paradigm• Complex problems are best solved using
simple solutions.
VI. Designeth not for complexity, but for simplicity; and wherever…
"Make everything as simple as possible, but not simpler”
Albert Einstein
VII. Thou shalt not kill (maintainability)
7th commandment
VII. Thou shalt not kill (maintainability)
• Coding standard that everybody follows• Keep your code under control– Size– Complexity
• Remove dead code
VIII. Thou shalt not repeat yourself
8th commandment
VIII. Thou shalt not repeat yourself (Copy)
8th commandment
VIII. Thou shalt not repeat yourself
• Copy/paste temptation• Clones mutations• Extract and reuse ASAP• Tools that support clone detection
IX. Thou shalt speak up early and often
9th commandment
IX. Thou shalt speak up early and often
• Effective communication within team– Trust– Weak and strong points
• Effective communication within business– Communications channels– Open and honest– Provide options
• No decisions vs. bad decisions
X. Thou shalt recognize and retain your top talent.
10th commandment
X. Thou shalt recognize and retain your top talent.
• Non fungible people• Experience + talent• Retention policy• “Hit by a bus” vs. “Upset and unhappy”• People gardening – fertilizers vs. weed control
Thanks to:
Pictures• http://www.flickr.com/photos/biscuitsmlp/3439419556/in/photostream/• http://orangeroom.deviantart.com/#/d4rsmkf• http://www.flickr.com/photos/imnotquitejack/4099186535/
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
Big thanks
Questions?
https://joind.in/6290
Q&A