Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
DevSpace would like to thank our
sponsors!
Creating
Code
30%
Maintaining
Code
70%
Writing…
Reading…
Describe the entity it represents
Describe the entity it represents
Easy to understand and read
Describe the entity it represents
Easy to understand and read
Be specific as possible
Bad Names
total, ct, checks, CHKTTL
velt, tv, train
cd, current, c, date
lpp, lines
Good Names
runningTotal, checkTotal
tr...
Don’t use magic numbers
Don’t use magic numbers
Instead use constants, enums or config
Don’t use magic numbers
Instead use constants, enums, or config
Makes code more readable / self documenting
Duplication leads to maintenance issues
Duplication leads to maintenance issues
Y2K Culprit?
Duplication leads to maintenance issues
Y2K Culprit?
“Every piece of knowledge must have a single,
unambiguous, authoritat...
Each responsibility is an axis of
change
Each responsibility is an axis of
change
Change is going to happen
Each responsibility is an axis of
change
Change is going to happen
Loose Coupling
Legacy Code = Code without Tests
Legacy Code = Code without Tests
Great Step-by-step guide
Legacy Code = Code without Tests
Great Step-by-step guide
Write unit tests as you use legacy code
Author + 2 Reviewers
Author + 2 Reviewers
Using “peer pressure”
Author + 2 Reviewers
Using “peer pressure”
Encourages collaboration
Keep a positive attitude
Keep a positive attitude
Check your ego
Keep a positive attitude
Check your ego
Review all code
Keep a positive attitude
Check your ego
Review all code
Code Review early and often
Give better variable names
Give better variable names
Don’t use magic numbers
Give better variable names
Don’t use magic numbers
Keep your code DRY
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Write Unit Tests
Give better variable names
Don’t use magic numbers
Keep your code DRY
Classes should do one thing
Write Unit Tests
Have re...
http://lunamark.com
http://bit.ly/ds2016-wc4fy
The Mythical Man Month by Frederick P. Brooks Jr (http://www.amazon.com/The-Mythical-
Man-Month-Engineering-Anniversary/dp...
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Write Code For The Future You
Upcoming SlideShare
Loading in …5
×

Write Code For The Future You

113 views

Published on

How many jobs will you have before you retire? A typical worker in the United States switches jobs every 4-5 years; in the tech industry stays are even shorter. Due to this software developers are guaranteed both to work on someone else?s code and someone will work on our code. To survive, it is critical you continue to add value by improving the quality of the code you write and/or maintain in your job as a software developer. In this session, we will define what it means to improve the quality of the code and give you practical steps towards improving it every day.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Write Code For The Future You

  1. 1. DevSpace would like to thank our sponsors!
  2. 2. Creating Code 30% Maintaining Code 70%
  3. 3. Writing… Reading…
  4. 4. Describe the entity it represents
  5. 5. Describe the entity it represents Easy to understand and read
  6. 6. Describe the entity it represents Easy to understand and read Be specific as possible
  7. 7. Bad Names total, ct, checks, CHKTTL velt, tv, train cd, current, c, date lpp, lines Good Names runningTotal, checkTotal trainVelocity, velocityInMph currentDate, todaysDate linesPerPage
  8. 8. Don’t use magic numbers
  9. 9. Don’t use magic numbers Instead use constants, enums or config
  10. 10. Don’t use magic numbers Instead use constants, enums, or config Makes code more readable / self documenting
  11. 11. Duplication leads to maintenance issues
  12. 12. Duplication leads to maintenance issues Y2K Culprit?
  13. 13. Duplication leads to maintenance issues Y2K Culprit? “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”
  14. 14. Each responsibility is an axis of change
  15. 15. Each responsibility is an axis of change Change is going to happen
  16. 16. Each responsibility is an axis of change Change is going to happen Loose Coupling
  17. 17. Legacy Code = Code without Tests
  18. 18. Legacy Code = Code without Tests Great Step-by-step guide
  19. 19. Legacy Code = Code without Tests Great Step-by-step guide Write unit tests as you use legacy code
  20. 20. Author + 2 Reviewers
  21. 21. Author + 2 Reviewers Using “peer pressure”
  22. 22. Author + 2 Reviewers Using “peer pressure” Encourages collaboration
  23. 23. Keep a positive attitude
  24. 24. Keep a positive attitude Check your ego
  25. 25. Keep a positive attitude Check your ego Review all code
  26. 26. Keep a positive attitude Check your ego Review all code Code Review early and often
  27. 27. Give better variable names
  28. 28. Give better variable names Don’t use magic numbers
  29. 29. Give better variable names Don’t use magic numbers Keep your code DRY
  30. 30. Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing
  31. 31. Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing Write Unit Tests
  32. 32. Give better variable names Don’t use magic numbers Keep your code DRY Classes should do one thing Write Unit Tests Have regular Code Reviews
  33. 33. http://lunamark.com http://bit.ly/ds2016-wc4fy
  34. 34. The Mythical Man Month by Frederick P. Brooks Jr (http://www.amazon.com/The-Mythical- Man-Month-Engineering-Anniversary/dp/0201835959) Code Complete by Steve McConnell (http://www.amazon.com/Code-Complete-Practical- Handbook-Construction/dp/0735619670) Clean Code by Robert C. Martin (http://www.amazon.com/Clean-Code-Handbook-Software- Craftsmanship/dp/0132350882) Working Effectively with Legacy Code by Michael Feathers (http://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052) FogCreek Software Blog Effective Code Reviews - 9 Tips from a Converted Skeptic (http://blog.fogcreek.com/effective-code-reviews-9-tips-from-a-converted-skeptic/) Stop More Bugs with our Code Review Checklist (http://blog.fogcreek.com/increase- defect-detection-with-our-code-review-checklist-example/)

×