[Info-vax] BASIC (and Horizon)
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Thu Feb 1 08:21:10 EST 2024
On 2024-01-31, Dan Cross <cross at spitfire.i.gajendra.net> wrote:
>
> I would argue this is more idiomatic, shorter, simpler, easier
> to both read and to reason about, and uses fewer variables.
>
I agree and this is the general style I use, but with one difference.
In my code, I always, always, use braces in an if() statement, even
if the conditional code is only a single statement. For example:
const bool parsed_ok = PyArg_ParseTuple(args, "Os", &items, &msg);
if (!parsed_ok)
{
return NULL;
}
I think that makes it more clear and removes any possibility of future
code changes accidentally not adding the braces at that time.
[And yes, about the above indentation, Simon _is_ indeed a Whitesmiths
person. :-)]
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
More information about the Info-vax
mailing list