Re: Coding style survey
From: Richard Bos (rlb_at_hoekstra-uitgeverij.nl)
Date: 01/28/04
- Next message: Alan Balmer: "Re: How do I inhibit warning 528?"
- Previous message: Bjarne Stroustrup: "Re: why is casting malloc a bad thing?"
- In reply to: Malcolm: "Re: Coding style survey"
- Next in thread: CBFalconer: "Re: Coding style survey"
- Reply: CBFalconer: "Re: Coding style survey"
- Reply: Malcolm: "Re: Coding style survey"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Jan 2004 14:53:08 GMT
"Malcolm" <malcolm@55bank.freeserve.co.uk> wrote:
>
> "Richard Bos" <rlb@hoekstra-uitgeverij.nl> wrote in message
> > > c), return is not a function. Though you want to ask why you are
> > > returning the return value from another function directly - this is
> > > unusual.
> >
> > Not at all. The function containing the return statement could be a
> > function which prepares the data for foo().
> >
> So there are exceptions. As a rule of thumb, however, if a function calls
> another function that returns a value, then the caller is the appropriate
> level to process that value - not simply to return it to a higher level.
Any reasons for that statement?
> If you need to prepare data for foo() then that would be an indication that
> foo() is badly written.
Nonsense. Look at the example I gave: it could easily be an indication
that foo() can work on any data, and the calling function uses it to
work on specific data.
Richard
- Next message: Alan Balmer: "Re: How do I inhibit warning 528?"
- Previous message: Bjarne Stroustrup: "Re: why is casting malloc a bad thing?"
- In reply to: Malcolm: "Re: Coding style survey"
- Next in thread: CBFalconer: "Re: Coding style survey"
- Reply: CBFalconer: "Re: Coding style survey"
- Reply: Malcolm: "Re: Coding style survey"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|