Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 13 Jul 2015 00:34:41 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: more robustness

On 2015-07-12 17:03, Alexander Cherepanov wrote:
> In many cases you put a constant in a comparison on the left. It was
> useful to some degree some time ago (to catch = instead of == in
> conditions). But it's quite unintuitive and current compilers warn about
> most improper cases (if you don't have parenthesis around the comparison).
>
> IMHO it's better to move all constants to the right.

Agreed. I need twice the time to review code using things like "if (NULL 
== ptr)" or "if (16 < i)". I know all the reasons but I still hate it. 
For things like "JtR coding style" though, I'm not sure we should go as 
far as to define things like this. It's better to have a good commit 
with a style some disagree with, than no commit at all. And maybe you 
didn't have that in mind at all.

> And my personal preference is to drop checks "!= NULL" completely. But
> this is something for a debate.

It's my preference too but I'm putting it down to just that: Personal 
preference.

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.