This is where you have it all wrong. If it’s easy to understand, it’s not a problem.
The biggest problem of messy, disorganised, bloated and otherwise poor code is exactly that it cannot be easily understood. It may lack structure, organisation and consistency. Program flow may be poor and convoluted. Code is generally buggy causing data integrity failure and a failure to handle anything but the most common or expected data. It may be superfluous and simply hard to read through atrocious formatting.
“Seriously, you’re crap too”
I would not say so. I make mistakes but am never responsible for the above. I do not know how it is even possible for some people to code so messily.
So often I’ve replaces a hundred lines of code with ten that are faster, more reliable, more accurate, bug free do at least as much as the original code, etc.
]]>This reading put me on thinking.
Besides being a science, the programming is also a continue developing, both in personal terms and in its scientific field. Considering a specific piece of code as being bad should be put firstly at the same level of thinking as it was made.
To be more clear, if someone in the past has made a great code for his/her level of knowledge and for that specific time language capabilities, in the present day it could be viewed as a primitive and rigid programming. But that does not mean at all it is a bad code by essence, but merely it is outdated. What do you think?
I think that before educating others, we must educate ourselves. I reached the conclusion that it’s pointless to get angry and yell at people for making mistakes, nothing will be solved.
If someone from the team wrote “bad code” and you are the one who has to deal with him, have a little conversation and make sure that the next time he won’t make the same mistakes, but try the slice of humble pie during that conversation. 🙂
]]>I’ve been the guy who replaced the spaghetti, no matter where or when I found it, with elegant, simple code (that didn’t always work). I’ve been the compulsive rewriter in every workplace I’ve been in.
Three years ago one of my sons was diagnosed as having Aspergers. I was “No he doesn’t – he’s just like me.” Now I realize he does, and he is. And I try to wind back those cracked up little monkeys in my head that make my brain hurt like it’s pickling in a jar of acid and rusted scrap metal when I look at code that stylistically differs from mine more than a little bit.
Rewriting crapsack code is part of coding. But if you’re doing it all the time, in every workplace you go to, maybe you need to step back. Take a breath. Spend some of that time on excercises to expand your own cognitive tolerance levels instead. Then take another look. Just saying.
]]>