3 ms·
If you don't have named parameters, you can fall back to variables var taxInvoice = false var sendEmail = true RaiseInvoice(taxInvoice, sendEmail) It's
by edflsafoiewq 2y ago
If you don't have named parameters, you can fall back to variables
var taxInvoice = false
var sendEmail = true
RaiseInvoice(taxInvoice, sendEmail)
It's obvious, but people tend not to do it.
- wrs 2y agoSadly there is nothing that can tell you that you got those arguments backwards.
- edflsafoiewq 2y agoPoint taken. But you can check the declaration of RaiseInvoice and see if the names match. If you had RaiseInvoice(false, true) then you really wouldn't know.
- wrs 2y agoTotally a matter of taste, but for an equal level of protection and less vertical waste I’d rather just do RaiseInvoice(/*taxInvoice*/ false, /*sendEmail*/ true)
- deleted 2y ago[deleted]