x404.co.uk http://www.x404.co.uk/forum/ |
|
Bad code http://www.x404.co.uk/forum/viewtopic.php?f=4&t=16166 |
Page 1 of 1 |
Author: | Fogmeister [ Wed Mar 28, 2012 1:38 pm ] |
Post subject: | Bad code |
I hate bad code. I'm trying to debug a program. It's only a fairly simple program (i.e. it doesn't actually do that much). If it had been written with any sort of structure I'd be able to find exactly which bit I'm looking for. However, it hasn't been. It's a recursive procedure too so unless you've written it you really need comments to fully understand how it's working and what it's doing. There isn't a single comment anywhere in the file. From glancing at the code and scrolling through it it looks like there are a few (maybe 3 or 4) separate bits that are all doing something specific so it would be very nice to abstract those bits into stand alone procedures that are self contained little blocks of code. In reality it's a 1100 line long .txt file with now separation or abstraction of code and absolutely no comments at all. ARGH! How can I be expected to know where the value of a certain variable comes from when it could have been set over any of around 700 lines of code?! GRRRR! |
Author: | finlay666 [ Wed Mar 28, 2012 7:20 pm ] | |||||||||
Post subject: | Re: Bad code | |||||||||
I see this sometimes, or old code commented out with no reason when/why/who did it Can't wait until I get to implement some proper check in scripts to stop people getting away with poorly commented files or methods, and force unit tests to be added as part of dev signoff, annoys me that most of my work in test isn't testing against spec but against minor dev errors, like mandating that a string field is required, but not validating the length of the string against the DB schema |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |