View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Unenforced AssumptionsIf you ever make an assumption, assert itIf the assertion fails, you immediately know either yourcode or your assumption is wrongAssertions help catch bugs closer to the sourceAssumptions should also be documented
Short Variable NamesVariable names should be descriptive andunambiguousModern IDEs provide auto-completion
Short Variable NamesBad examples: m temp billy var3 NINE abs
Short Variable NamesGood examples: accountNumber ﬁrstName x (when used as a cartesian coordinate)
Overly Intimate CodeOutside classes should only know what they needEncapsulation is one of the key principles of OOPClass extensions are great for private methods/dataCategories are great for protected methods/data