Keep It Simple, Stupid | |
PerlMonks |
Re^3: Programming *is* much more than "just writing code".by Rhandom (Curate) |
on May 08, 2007 at 23:14 UTC ( [id://614271]=note: print w/replies, xml ) | Need Help?? |
That would be great... assuming that those subroutines were able to to be passed the 20 variables that are in scope... and assuming that they are able to pass back the two or three variables that they modified.
You have given a nice contrived example that would certainly work under some conditions - but not this one ((sarcasm)which you "obviously" could've guessed without seeing the code(/sarcasm)). My example came from working code - a small random sample of tens of thousands of lines that are all broken into commented paragraphs. Some sections do look more like what you said - but not often. Yes I could break into a subroutine every 10 to 20 lines, but then I have a different problem -- the code is arguably more fragmented and less easy to follow and has to find other ways to pass around variables. Some sections of logic cannot be broken up without severely hampering readability, or without serious code mangling - but they can be broken into paragraphs with comment headings. Update: made sure that sarcastic comment is taken as such.
my @a=qw(random brilliant braindead); print $a[rand(@a)];
In Section
Meditations
|
|