Re: Programming style...
- From: Robert Marquardt <marquardt@xxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 07:53:38 +0200
Wan-Hi wrote:
2) error checking:
SetupDiGetClassDevs and many other functions return a specific value if they fail. so should i check for failure although such case is impossible? e.g. SetupDiGetClassDevs with GUID_DEVINTERFACE_VOLUME should never fail. i ask because useless failure checks make the code unreadable.
The error checks only make the code unreadable because MS prefers a *really* bad style. Excessive return and goto is about as bad as it can get. A clean if else style and a proper indentation solves that.
.
- Follow-Ups:
- Re: Programming style...
- From: Pavel A.
- Re: Programming style...
- From: David J. Craig
- Re: Programming style...
- References:
- Programming style...
- From: Wan-Hi
- Programming style...
- Prev by Date: AVStream driver performs differently under WinXP and Win2K.
- Next by Date: Re: Programming style...
- Previous by thread: Re: Programming style...
- Next by thread: Re: Programming style...
- Index(es):
Relevant Pages
|
Loading