![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Rewriting creation (with strict and warnings)by benn (Vicar) |
on Aug 30, 2003 at 13:51 UTC ( [id://287907]=poem: print w/replies, xml ) | Need Help?? |
Wondering about the whole human condition recently, I decided to have a look at some early
source code to see if it could be tightened up in any way, or even spot any glaring bugs. Ovid has had a look at Genesis before (which I think may actually be part of the Vedas:: namespace), but I wanted to check out the main 'init()' routine.
A quick Perl-rewrite-hack of John 1.1 initially produced the code below. Note - all code is untested - I didn't dare run it until after peer review.
My initial thoughts were that it looks like something more generic that has been cut down. That 'BEGIN' block looks a little suspicious - there's that unused variable...maybe this was initally part of a Create($maker) (where $maker could be "The Force" or "Jehovah" or "Allah" or whatever) routine that's been hacked about. Also, there's something funny with that "{men}{light} = 'life'" thing. I reckon there might have been a bit of a boo-boo, and he ends up assigning "Godlife" to "light" rather than the other way round. As this then gets passed to "darkness", no wonder he was getting errors in his test suite. So... refactoring and removing the "I made this, honest!" copyright stuff gives us something like this... ...which I'm sure you'll agree is a lot neater, and a better base for expansion. Any volunteers for a sourceforge project? Ben.
Back to
Perl Poetry
|
|