in reply to Re^3: Writing general code: real world example - and doubts!
in thread Writing general code: real world example - and doubts!
You're right, readability suffers with that approach. Because code is invoked at a distance, and there is no local indication of which variables are covered by the validation mechanism, the reader needs to absorb the ties before getting to the real code. That's likely to be missed by a maintainer.
Documentation helps, comments help, but those may not be enough. You spotted the principal weakness.
I'm not yet encouraging anyone to use Tie::Constrained in production. The API is not yet stable, simple as it is. I'll make a version 1.00 release when I think it's ready. If you have suggestions, I'd welcome them.
After Compline,
Zaxo
|
---|