:: Re: [DNG] Starting outline for the …
Top Page
Delete this message
Reply to this message
Author: Steve Litt
Date:  
To: dng
Subject: Re: [DNG] Starting outline for the DNG Safe Programmer Certificate
Josef Grosch via Dng said on Thu, 29 Jul 2021 15:55:03 -0700

>On 7/28/21 1:12 PM, Steve Litt wrote:
>> [ Beverity ]
>> Does anyone have other list items to add?
>>
>
>Now that you got me thinking;
>
>One should be explicit instead of implicit. I see this in code all the
>time and it drives me crazy
>
>
>// NO
>
>if (condition)
>
>     doSomething();
>
>
>// YES
>
>if (condition) {
>
>     doSomething();
>
>}


The preceding is reasonable. But sometimes, readability is best served
with:

if (condition) doSomething();

I think the preceding should be allowed, when it makes things clearer.

if (no_record_found) show_error_and_exit("No record found", 1);

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques