Keep It Simple, Stupid | |
PerlMonks |
Re: "Biochem BINGO" or "Noob Seeks Zen Thrashing"by mrborisguy (Hermit) |
on Dec 12, 2005 at 19:01 UTC ( [id://516107]=note: print w/replies, xml ) | Need Help?? |
My only suggestion, since I knew I wouldn't be able to handle reading through this, is to clean up your code. Make it look nice. That may sound very picky and worthless, but really it is very helpful for anyone trying to understand your code. This may seem kinda stupid, and I can't really explain why I have this preference - maybe it's for general aesthetic appeal, which frankly is important to my stress levels when maintaining code - but drop the long lines of pound signs/comment signifiers/whatever you want to call em.
Try to put one comment at the beginning of a 'block' of code, and seperate these blocks with an empty line. And if you consistently put all of your subs at the end of your files (like it looks like you do), then people will see your first sub declaration and assume that the rest of the file is subs. So you probably don't even need to denote that with a # FUNCTIONS 1 comment. And then in your second piece of code, try this. I didn't change any of your code, I just added indents, and put newlines in places. It immediately made the code a lot more understandable. For one, I didn't even realize there was a while block on the first glance, but after showing the blocks better, it's more obvious that these are looping until they return. Also, after indenting and putting things on seperate lines, I realized that you try to print after you return from the sub.
I guess the point I'm trying to make is try to keep your code clean and looking nice. You'll find it does wonders. -Bryan
In Section
Seekers of Perl Wisdom
|
|