|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: Flag variablesby gmax (Abbot) |
| on Mar 03, 2003 at 12:20 UTC ( #240003=note: print w/ replies, xml ) | Need Help?? |
|
As a significant example of why flags can be messy, check this particularly thorny source code. I needed to use that module and I found out that it was faulty. I tried to fix it, but its logic eluded me. I contacted the author, who didn't do anything, and therefore I wrote my own parser using a rather different approach. This module is supposed to parse chess games. The problem in this code is that it skips the last game in each file it parses. I was able to spot where the problem is. As for fixing it using the same labyrinth of flags system, I simply couldn't. This code uses not one but THREE flags, transforming a would-be OOP module into a peculiar example of spaghetti code.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||