tags:

views:

172

answers:

3

Possible Duplicate:
What are some bad programming habits to look out for and avoid?

This is not a Code Smells question, but a Coding Smell Question aka programmer's working habits. What are known coding smells and steps to correct them. Example:
Coding Smell: the programmer never checks to see if there is an existing class or function and always build everything from scratch (including simple sorts).
What can be done:this is either caused by a programmer who doesn't know better OR has no faith in anyone else's work. Mentoring on how to find existing classes/functions for the jr coder and a good discussion on not reinventing the wheel to the cowboy.

Please - one smell per answer

A: 

What you mentioned are not code smells.

A code file has 10-20-30+ thousands of lines, contains definitions of several classes and their methods are 10-20-30+ pages long.

Diagnosis: too much responsibility has been given to the classes and methods.

Cure: Split classes to separate files, refactor classes and methods to perform one specific task and not solve all the world problems.


EDIT: Okay, i haven't read the question thoroughly and just started to answer. You can consider it also a coding smell: looking the specs through, thinking you know what they want, starting to implement them and then discovering they wanted something different but you were too lazy to read.

User
I guess that is why meade pointed that out in the question.
Fredrik Mörk
Regarding the edit: I do that all the time as well. If you find a cure, let me know :o)
Fredrik Mörk
+5  A: 

If you aren't looking for code smell, but instead bad programming habits then try the question about What are some bad programming habits to look out for and avoid?

rmoore
A: 

Coding Smell: Hogging the code. The developer will not release/submit/commit the code until they think it's perfect.

What can be done: I don't know. Violence is against company rules.

Nifle
Why? Is it explicitly prohibited in the code of conduct?
User
Beatings may only be delivered by HR.
Nifle