File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 14688

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: 14688

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!
I agree. Here's the link:
subject: Code Craft: bad smells
It's not a secret anymore!