5 ms·
The idea is to write a wrapper that encapsulates all of the (related) data. This is useful in type-checked languages where changing the signature can have repe
by dhimes 14y ago
The idea is to write a wrapper that encapsulates all of the (related) data. This is useful in type-checked languages where changing the signature can have repercussions across multiple classes.
I actually do this in javascript, too. I'll pass in object (it's nice in js because you can just write them in json) and refer to the variable by object property
verifyID({idNum: 1234, surname: 'Himes', firstName: 'Dan'});
{where the signature is
verifyID(idObect)
}
This has the advantage of not requiring you to remember the order of parameters.