Reply to topic  [ 2 posts ] 
Bad code 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
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!

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Wed Mar 28, 2012 1:38 pm
Profile WWW
Spends far too much time on here
User avatar

Joined: Thu Apr 23, 2009 9:40 pm
Posts: 4876
Location: Newcastle
Reply with quote
Fogmeister wrote:
In reality it's a 1100 line long .txt file with now separation or abstraction of code and absolutely no comments at all.


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

_________________
Twitter
Charlie Brooker:
Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.


Wed Mar 28, 2012 7:20 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.