Comments on: How to deal with bad code https://j11y.io/general/how-to-deal-with-bad-code/ Sun, 22 Mar 2015 15:39:22 +0000 hourly 1 https://wordpress.org/?v=5.0.13 By: nope https://j11y.io/general/how-to-deal-with-bad-code/#comment-2629 Mon, 30 Sep 2013 06:40:07 +0000 https://j11y.io/?p=2217#comment-2629 “It’s dead easy to understand.”

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.

]]>
By: Alex https://j11y.io/general/how-to-deal-with-bad-code/#comment-2628 Fri, 24 May 2013 14:02:15 +0000 https://j11y.io/?p=2217#comment-2628 Hello James,

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?

]]>
By: AdrianC https://j11y.io/general/how-to-deal-with-bad-code/#comment-2627 Thu, 23 May 2013 07:36:59 +0000 https://j11y.io/?p=2217#comment-2627 “Seriously, you’re crap too”. Why is this the hardest thing to grasp for many of us? 🙂

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. 🙂

]]>
By: Sasha https://j11y.io/general/how-to-deal-with-bad-code/#comment-2626 Mon, 20 May 2013 23:46:23 +0000 https://j11y.io/?p=2217#comment-2626 Good article! It’s a shame that it happens so often, though…

]]>
By: Dan Sutton https://j11y.io/general/how-to-deal-with-bad-code/#comment-2625 Sun, 31 Mar 2013 17:21:04 +0000 https://j11y.io/?p=2217#comment-2625 …but where would we programmers be without that visceral, cathartic release provided by abusing other programmers to their faces…?!!

]]>
By: Andrei Solntsev https://j11y.io/general/how-to-deal-with-bad-code/#comment-2624 Sun, 31 Mar 2013 09:35:31 +0000 https://j11y.io/?p=2217#comment-2624 Brilliant post, thank you!

]]>
By: Sunny https://j11y.io/general/how-to-deal-with-bad-code/#comment-2623 Fri, 29 Mar 2013 01:02:26 +0000 https://j11y.io/?p=2217#comment-2623 Awesome article!..sometiems i wrote bad codes.. I didn’t concern about that.

]]>
By: Galdin https://j11y.io/general/how-to-deal-with-bad-code/#comment-2622 Wed, 27 Mar 2013 04:43:49 +0000 https://j11y.io/?p=2217#comment-2622 Awesome man – loved the Educate part!
It makes a lot of sense to write a blog post like this then!

]]>
By: Mr Snippy https://j11y.io/general/how-to-deal-with-bad-code/#comment-2621 Wed, 27 Mar 2013 04:24:51 +0000 https://j11y.io/?p=2217#comment-2621 If you spend a huge amount of time rewriting other peoples code (recluctantly or otherwise) year after year then maybe you need to ask yourself why.

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.

]]>
By: patbob https://j11y.io/general/how-to-deal-with-bad-code/#comment-2620 Tue, 26 Mar 2013 20:34:07 +0000 https://j11y.io/?p=2217#comment-2620 The only difference between good code and bad code, is that bad code isn’t written the way you’d expect, for what it’s doing. Always consider the possibility that you might not have the full story of what it’s doing. If you can’t see a technical reason for it, ask the developer. But, ask non-confrontationally, less “Hey Joe, why’d you write this steaming pile of * this way?” and more “Joe, do you recall why you wrote this code this way?”. The former will usually get the most face-saving answer, whereas the latter will ocassionaly educate you.

]]>