Thursday 15 May 2014

coding style - Is it acceptable to have useless code? -


I think some programmer add code, which does nothing useful after all (C #) for example:

  [serializable] class foo {// ... string serializeMe () {New XmlSerializer back (typef (this)). Serialize (this). ToString (); // serialize to xml (syntax is incorrect, not important here)}}  

The class is marked as serialjob, but this is the only way that is serialized, XML Through the serialization, which is not required

I personally hate such useless codes, but I often see it and I'm curious about what others feel about it. Is not it so serious after all? Is it common in the industry? Or is it just plain bad and does not make any difference what should be removed?

Does it also take if you yes (and I think it is like this ) Then the minimum effort to read additional code (as code, idle)?

If yes (and I think this is so) then the code should not be in the code. This type of code has been polluted with an additional snippet which is not useful, they are "in the case of bus".
"Refactoring later on" can be painful, after 6 o 12 months, who is going to remember if it is actually used?


No comments:

Post a Comment