Which things instantly ring alarm bells when looking at code? [closed]
- by FinnNk
I attended a software craftsmanship event a couple of weeks ago and one of the comments made was "I'm sure we all recognize bad code when we see it" and everyone nodded sagely without further discussion.
This sort of thing always worries me as there's that truism that everyone thinks they're an above average driver. Although I think I can recognize bad code I'd love to learn more about what other people consider to be code smells as it's rarely discussed in detail on people's blogs and only in a handful of books. In particular I think it'd be interesting to hear about anything that's a code smell in one language but not another.
I'll start off with an easy one:
Code in source control that has a high proportion of commented out
code - why is it there? was it meant
to be deleted? is it a half finished
piece of work? maybe it shouldn't have
been commented out and was only done
when someone was testing something
out? Personally I find this sort of
thing really annoying even if it's just the odd line here and there, but when you see large blocks interspersed with the rest of the code it's totally unacceptable. It's
also usually an indication that the rest of
the code is likely to be of dubious
quality as well.