|
|
|
|
|
by trylist
2787 days ago
|
|
I'm starting to look at it from a different perspective. I don't necessarily think bad is actually bad, or a better way to put it, there's no such thing as "good" code. What I usually find people calling bad code is just not easily understandable. We as programmers started programming with really comfortable abstractions for easy problems and we expected things to continue like that. When we go into the world of unsolved problems that someone solved and we have to maintain them, and we can't understand them immediately, we call them bad. It's my gut reaction almost every time I'm confronted with something that doesn't immediately enlighten me, even thought I know it's the wrong reaction. We are always comparing everything to the simplest and most solved problems that were easy for us to understand. When it isn't so easy we call them "bad". |
|
That happens in code all the time. People do things in ways that are prone to problems because either they don't have the experience to know better, or they didn't take the time to think about the domain. I would call that "bad code", no matter how pretty it looks or understandable it is.
Part of the problem is that "good" and "bad" are far too vague, so everyone will bring their own meaning. You might see people using "bad" to mean unclear, but I would count that as a sign of progress. A imagine a "bad" mechanical in this day and age engineer is someone that does stuff that costs more money, either now or later when it breaks early, but still produces mostly safe constructs because that portion of the job is highly constrained, and when they fail there, they often aren't just "bad", but may be criminally negligent if they failed to adhere to both the law and industry best practices.
If were getting to the stage that "bad" programmers are just ones that write unclear code, that's a huge step up. Unfortunately, I don't think we are there.