Re: default parameter value

From: Karl Heinz Buchegger (kbuchegg_at_gascad.at)
Date: 11/04/03


Date: Tue, 04 Nov 2003 09:42:05 +0100


lilburne wrote:
>
>
> When default arguments creep into our programs it is usually
> because someone is retrofitting a flag to the API of some
> method, and they can't be bothered to fix up all the places
> that the API change requires. In other words they are
> hacking (perjorative sense).

Even in this cases I prefer to add the missing arguments
on the callers side. The compiler will flag all code spots
where a call is done. Since it is possible to give a default
value, it is also possible to insert that very same defaut
value on the callers side. But it has the nice benefit of
looking at each call and doing a quick search in the callers
code, if the default is really apropriete. It happend more then
once that I figured out in less then 30 seconds that it was not :-)

-- 
Karl Heinz Buchegger
kbuchegg@gascad.at


Relevant Pages

  • Re: FileSystemWatcher Created() delay
    ... It's using FindFirstChangeNotification. ... The flag options correspond ... In the API, ... The try clause would end by exiting the loop. ...
    (microsoft.public.dotnet.general)
  • Re: Binder API...broke or working as designed
    ... -- work for authorized callers running in their state and key and not come ... Yes, of course, an application could at runtime select which subpool to ... API says... ...
    (bit.listserv.ibm-main)
  • Re: sendfile(2) SF_NOPUSH flag proposal
    ... >> the API have to change to fix the root cause of the problem? ... The "Subject:" line says you want to add a flag. ...
    (freebsd-arch)
  • Re: [patch 1/2] splice: dont steal
    ... We should be able to allow for it with the new a_ops API I'm working ... flag and make splice pass down the page, and set that flag when stealing. ... Filesystems might vary from trivial to impossible, ... The prepare_write should fail, ...
    (Linux-Kernel)
  • Re: VPN using RASDIAL default gateway problem
    ... it's very unlikely there is some kind of custom app running on my local box, ... If I open the connection and look at IPconfig, ... default gateway problem I see when using the rasdial api. ... look back at the phone book file, the IpPrioritizeRemote flag gets set to 1. ...
    (microsoft.public.win32.programmer.networks)