Your SlideShare is downloading. ×
Clean Code @Agileworks Romania 2013 05 23
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Clean Code @Agileworks Romania 2013 05 23

167
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
167
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Clean Code
  • 2. Clean Code Adi Boboacă @adibolb Alex Bolboacă @alexboly
  • 3. Clean Code
  • 4. Clean Code Code is more often read than written www.mozaicworks.com
  • 5. Clean Code – Environment Build Requires One Step Build time is manageable Tests Execution Requires One Step Always Use Source Control Have Continuous Integration
  • 6. Code Smell Sniffable Easy to spot Does not always indicate a problem www.mozaicworks.com
  • 7. Code Smell A code smell is a hint that shows you might have a problem in your system. ' www.mozaicworks.com
  • 8. Coding Smells - Design Misplaced Responsibility Code at Wrong abstraction Level Fields Define Temp Variables Hidden Temporal Coupling Over-engineering Usage of Singleton / Statics / new Interface Has Too Many Methods
  • 9. Clean Code - Design Be Precise Don't Be Arbitrary Keep Configuration at High Levels Prefer Polymorphism Over conditionals Prefer Composition Over Inheritance S.O.L.I.D.
  • 10. Coding Smells – Naming There Are Several Naming Standards More Names Mean The Same Concept Someone Needs To Explain You The Code
  • 11. Clean Code – Naming Use Standards For The Language Names Use Domain Language Names Describe The Intention Names Do Not Use Hungarian Notation Names Do Not Contain Encodings
  • 12. Coding Smells - Methods Method Has More Than 3 Indents Method Uses Getters From Other Classes There Are Static Method Methods & Ctors Have More Than 3 Args Arguments Have out Or ref
  • 13. Clean Code - Methods Have Only One Responsibility Use Only Internal State (No Feature Envy) Avoid Static Have Maximum Two Arguments Do Not Pass Reference As Arguments
  • 14. Coding Smells - Variables You see a, i, bla, etc. As Variables You see string, int, float, In Classes There Are Static Variables In Classes Use Integers for Currency
  • 15. Clean Code - Variables Use Explanatory Variables Always Encapsulate Primitives Avoid Statics Use Appropriate Types
  • 16. Clean Code - General Boy Scout Rule Keep It Simple, Stupid (KISS) Delete Commented Code Delete Unused Code Minimize Duplication
  • 17. Clean Code http://www.mozaicworks.com Extend your mentoring & training capacity Accelerate learning through communities of practice Grow your functional leaders and top talents @alexboly @adibolb
  • 18. Clean Code Q&A, Beer & More... www.mozaicworks.com