in reply to Re^5: How should named paramater keys be named?
in thread How should named paramater keys be named?
I hear your arguments, and did state that this is just an example of what can be done. I also do not think I have ignored your argument of parameter checking, as I stated early on that there is no excuse for not checking parameters and return codes. I also stated that not always can a value be defaulted--this example just provided a way of showing setting a default value. Poorly chosen or not, this is a simple example to illustrate.
I always enjoy conversing with you on matters, as I enjoy the different point of view. But let us remember, Examine what is being said, not who is saying.... This was just a quick example, and all I have said is that named parameters can have value. If it is your stance that they can have no value, then I respectfully disagree.
There is a product called PowerKeeper that implements a programmatic interface much as you have described-- foo( opt1, opt2, opt3, optn ). Let's just look at the AddSystem API for a moment:
AddSystem System,['][ReservedParameter],[NewSystemName], NetworkAddress,[PrimaryEmail],PlatformName, [ChangeFreq],[ReleaseDuration],[SystemAutoFl], [\"][FunctionalAccount][\"], [FunctionalAcctCredentials],[ChangeTime], [PasswordRule],[PropagateFlag],[PortNumber], [EnablePassword],[AlternateIP],[Description], [DomainFunctionalAccount],[BoksServerOS],[LineDef], [Timeout],[DomainName],[OracleType],[OracleSIDSN], [CheckFl],[ResetFl],[ReleaseChgFl],[NetBIOSName], [MaxReleaseDuration],[PropagateToAliasesFlag], [SecretPassUsedFl],[ParentSystem] [,LDAPServer,ConnectionEncryption, \"SearchBase\",[AccountNameAttributeName], [PasswordAttributeName],PasswordReadability, [LDAPPort],[MultiValuedPasswordFl],[StoreClearTextFl], [StoreCryptFl],[StoreMD5Fl],[StoreSHAFl], [StoreSMD5Fl],[StoreSSHAFl]][']
There are 47 options, and none named. Moreover, all parameters are position dependent. So by your logic, it is easier to remember that the 'CheckFl' belongs in field 26? I think this is the spirit of the PBP when it comes to when to use named parameters.
To exclude possibility is to limit oneself, to blindly accept is to subjugate ones mind, to explore is to learn. --Poet
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: How should named paramater keys be named?
by BrowserUk (Patriarch) on Jul 04, 2011 at 01:11 UTC |