permaculture playing cards*
The moose likes Agile and Other Processes and the fly likes Code Craft: bad smells Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Agile and Other Processes
Bookmark "Code Craft: bad smells" Watch "Code Craft: bad smells" New topic

Code Craft: bad smells

Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Mr Goodliffe,
You were talking about "bad" code in another thread,
and I would like to know if your book also talks about "bad smells" and how to avoid them. Like in "Refactoring: Improving the Design of Existing Code, Martin Fowler" or "Refactoring to Patterns, Joshua Kerievsky".

[My Blog]
All roads lead to JavaRanch
Swapnil Shroff
Ranch Hand

Joined: Mar 07, 2006
Posts: 58
What is bad smells

SCJP 5, SCDJWS<br /> <br />It's amazing how premature optimisation is both seductive and destructive; even when you know
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

A simple example of a bad smell is when you have the same piece of code here and there. It smells bad, and you know you've got to do something about it, like could put that code into one function.

You'll find a short intro at Wikipedia :
[ February 22, 2007: Message edited by: Satou kurinosuke ]
Pete Goodliffe

Joined: Feb 02, 2007
Posts: 24
"Code smells" are a powerful metaphor found in Fowler's classic Refactoring book.

Code Craft does talk about refactoring (in the chapter about code evolution, naturally) but doesn't repeat all of Fowler's book!
Consider Paul's rocket mass heater.
subject: Code Craft: bad smells
Similar Threads
another design question on 'program to interfaces' or not
OO Calculator -- a Tutorial
experience with refactoring on large projects
refactoring beginner
Bad Code/Design Practices