{ clean code } - finding marbles · clean code = code usability bildquelle:
TRANSCRIPT
{ Clean Code }Lesbar, wartbar, erweiterbar
Uncle Bob wants you to write Clean Code*
Buch: http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882Videos: http://cleancoders.com/
* so does everyone who’ll ever have to work with your code
Fragile
Unreadable
Clean Code = Code Usability
Bildquelle: http://www.sxc.hu/photo/785502
What’s in a name?
Marker: You’re naming something
Bildquelle: http://www.sxc.hu/photo/1438328/
Reveal
IntentBildquelle: http://www.sxc.hu/photo/626209
Nice summary of the “Naming” chapter: http://www.itiseezee.com/?p=83
Reveal
IntentBildquelle: http://www.sxc.hu/photo/626209
Marker: You want to comment
/* No comments! */
Reveal
IntentBildquelle: http://www.sxc.hu/photo/626209
Marker: You’re writing a condition
if (isCondition())
Don’t make me think
Marker: You’re passing a Boolean into a function
http://www.sxc.hu/photo/365439
Pfadfinder-Regel
Marker: You see ugly code
Bildquelle: http://www.sxc.hu/photo/1438328/ Bild
quel
le: h
ttp://
ww
w.s
xc.
hu/p
hoto
/513
169
DRY
Marker: Duplication
Bildquelle: http://www.eurobricks.com/forum/index.php?showtopic=18914&st=25
Extract method
Marker: Long function || many indentations
Bildquelle: http://www.flickr.com/photos/cives-expat/9512089306/
Bildquelle: http://codeguide.hu/2013/08/08/tesztvezerelt-fejlesztes-tdd/
Marker: You’re about to write new code
● Better design● Safe refactoring● Tests as
documentation
Code Katas
Bildquelle: http://www.sxc.hu/photo/1438328/
http://codersdojo.org/
Bildquelle: http://www.flickr.com/photos/the-consortium/5301701486/Code with other people!
Clean Code Developerhttp://www.clean-code-developer.de/
SoftwerkskammerTreffen jeden 2. Mittwoch im Monat
http://softwerkskammer.org
The End
Tell, don’t ask
Tell, don’t ask
Bildquelle: http://martinfowler.com/bliki/TellDontAsk.html
● Bundle logic & data
Law of Demeter
Marker: $this->getDog()->getLegs()->posX
Bildquelle: http://www.sxc.hu/photo/558572