3 classics for every developer!

Post on 13-Jan-2015

86 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

Every developer should read these three software development classics. First up is Refactoring from Martin Fowler. Next up is Clean Code from Robert C. Martin, and the last classic is The Pragmatic Programmer by Andrew Thomas and David Hunt. These three books teach many good lessons the new and experienced developer need to learn.

TRANSCRIPT

3 Classics for every developer!Tom Henricksen

IT Career Coach, Author, Speaker

Refactoring● Refactoring: Improving the Design of

Existing Code. ● Author: Martin Fowler● Published: 1999

Refactoring“Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code yet improves its internal structure”

Refactoring● Code works, hard to read● Maintenance issue!● Human readable

Refactoring“Before you start refactoring, check that you have a solid suite of tests. These tests must be self-checking.”

Refactoring● Improve design● Find bugs● Performance gains

Refactoring● When

○ Add method○ Fix bug○ Code review

● Rule of 3

Refactoring● When not

○ Mess○ Deadline

Refactoring● Bad Smells

○ Duplicated○ Long method○ Large class○ Long parameter list

Refactoring● Techniques

○ Extract Method/Class○ Rename○ Encapsulate Field○ Magic number removal

Clean Code● Clean Code: A Handbook of Agile Software

Craftsmanship● Author: Robert C. Martin● Published: 2008

Clean Code“The answer confirmed my fears. They had rushed the product to market and had made a huge mess in the code. As they added more and more features, the code got worse and worse until they simply could not manage it any longer. It was the bad code that brought the company down.”

Robert C. Martin

Clean Code● Simple● Elegant● No duplications● Minimal dependencies

Clean Code● Readability

○ Basics■ variable names■ method names

Clean Code“Any fool can write code a computer can understand. Good programmers write code that humans can understand.”

-Martin Fowler

Clean Code● Important

○ Easy to read○ Easy to understand○ Easy to change

● Cheaper to Maintain

Clean Code● Good naming

○ Poor: int d;○ Better: int days;○ Best: int daysToCompletion;

Clean Code● Bad comments

○ RedundantgetDaysToRenawal(); // gets days to renewal● Funny//Ninja code following this!

Clean Code● Good naming conventions● Small methods● Small classes

Clean Code● Boy Scout rule● Smart vs Professional

The Pragmatic Programmer● The Pragmatic Programmer: From

Journeyman to Master● Author: Andrew Hunt, David Thomas● Published: 1999

The Pragmatic Programmer● Craftsman● Think!● Knowledge Portfolio

The Pragmatic Programmer● DRY● Master your tools● Code generation

The Pragmatic Programmer● Crash Early!● “Shy” code● Dig for requirements

The Pragmatic Programmer● Design to Test● Script it● Communicate

top related