Alex.C.Punnen
Alex .C.Punnen
Code Smell ?
The problem
What is the problem with smelly ?
The Principle of Abstraction Abstracting to reduce duplicated code The Liskov Substitution Principle [link]
Reading http://en.wikipedia.org/wiki/Category:Programming_principles
Being aware is the beginning of the journey to programming salvation.... Note For most of these principles the Aha! effect happens when you experience
it in real world
Code Smell -Duplicate Code Identical or similar code spread in multiple places
Extract a method
Note -For unit tests a certain amount of code duplication may be needed, and could be tolerated
http://c2.com/cgi/wiki?TallerThanMe
Problems Very hard to subclass,extend kills OCP Why did Dinosaurs become extinct ?
Solution
Read more ,and do deliberate practice, design and re-factor your
design at least N times. (N inversely proportional to experience) Read - http://en.wikipedia.org/wiki/Solid_(object-oriented_design)
It is knowledge that separates the wise from the rest; the former acutely aware of what they don't know, the latter acutely aware of what they know.....
Code Smell
Programmer - So how do I.. ? er.. smell it ? It is easy ! use FindBugs,PMD,Checkstyle & other code analysis tools or/and integrate and check via SONAR
Author - alex.cp@nsn.com
Author - alex.cp@nsn.com
You have balanced between reuse and unuse Balanced between elegance and purpose Balanced between effort spent and value gained
Advice Warning
Some of the books which I have put here I have not personally read and
I wont be liable for any monetary damage that you could possible incur by buying on my advise. Some of the advice that I have put here,I have not personally practicedat least consciously, but looked like very good advise nevertheless; so though I could take credit on the mileage you might garner,I wouldn't be responsible for any adverse ill effects including mental strain and frustration you might experience in following my advise.
License
You are freely allowed (and encouraged) to pass on the advice and use
these slides as long as you put these warnings and acknowledgments in your slides