in reply to Data checking configuration files
I typically ignore checking config file contents when it is first loaded. Instead I get the functions using those settings to validate the data.
This way, if I choose to switch the input origin for the function (such as from config file to user input through a website), I know the input is still being validated before being consumed, without having to rebuild the cart, so to speak.
I don't think your way is wrong at all, just different :)
EDIT: In addition to the above, moving data validation into the consuming function makes the function complete within itself, which allows for greater code-reuse (if you're that way inclined).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Data checking configuration files
by BillKSmith (Monsignor) on Sep 17, 2015 at 20:03 UTC | |
by SimonPratt (Friar) on Sep 18, 2015 at 11:42 UTC |