Re: [i3] Buggy conditional test?

  • From: Mateusz Poszwa <old4@xxxxx>
  • To: Discussions/Questions about the i3 window manager <i3-discuss@xxxxxxxxxxxxx>
  • Date: Thu, 30 Jan 2014 13:26:40 +0100

On Thu, Jan 30, 2014 at 12:58:51PM +0100, Alexander Berntsen wrote:

On 30/01/14 11:07, Michael Stapelberg wrote:
Marco Hunsicker <i3@xxxxxxxxxxxx> writes:
if (con->window && con->window->name)
if (con->window && con->window->name != NULL)
These two lines do exactly the same thing in C.
It's obviously not a bug, but consistency is neat. If I write you a
patch that makes this consistent (I'll look for others as well),
would you apply it? Do you prefer the former or the latter?
Personally, I prefer the latter.

IMHO, that would be inconsistent. I'd say either the former or

if (con->window != NULL && con->window->name != NULL)

I find it less readable, so I vote for leaving it as it is now.
Too much purism may be harmful. ;-)

Regards.

--
Mateusz Poszwa

Other related posts: