Typical Code Smells
While doing daily development in various project we often found lots of
coding standard problem, we just don’t know the appropriate vocabulary
for that, Today I am providing a list of all code smells that can be
found in codes, We would elaborate and learn about each code smell.
The code that is no longer needed and no longer used by any function or procedure is a dead code. You would be
surprised to know how many dead code exists in your project when you
take a close look at the project file. of course you wouldn’t know just
by looking at it. some of them are pretty hard to find.
Technical debt (also known as design debt or code debt) is a neologistic
metaphor referring to the eventual consequences of poor software
architecture and software development within a codebase. The debt can be
thought of as work that needs to be done before a particular job can be
considered complete. As a change is started on a codebase, there is
often the need to make other coordinated changes at the same time in
other parts of the codebase or documentation. The other required, but
uncompleted changes, are considered debt that must be paid at some point
in the future.
Duplicate code is one of the most common code smell we have in our
codebase. Its simply we don’t care that much about reusing, we know how to
reuse objects, functions, even solutions or component but we are some what
careless about removing duplicate code. You would be surprised to know that
what amount of duplicated code exists and what are those? Off course there
are some obvious techniques to eliminate those.
Sounds like some thing is been told wrong, yes you guys heard right, comment is one kind of smell. The days of well documented code with comment are gone, now time has changed and new agile wind is flowing, as a result comments are now considered as code smell. How Comment is smell? Who would have thought
You wont find a single project where long method code smell is not present. I find often this code smell often in my projects, and developers do not deliberately introduce long methods, it just got introduced along the way when we introduce features. What happen when you find a long method? You wonder why is this method is so long. You try to understand what the code is doing