A
Anders Borum
Hello!
While in-between sessions at the Tech-ED in Barcelona, I overheard a
discussion between some developers. The subject of the discussion was code
layout (i.e. how each developer formats and writes code). What are your
takes at the following two examples? Which one would you choose and why?
// may be easier to read for short statements
if (boolean == false) {}
if (DetermineResultFromMethod(arg1, arg2) == false)) {}
or
// easier for longer statements?
if (! boolean) {}
if (! DetermineResultFromMethod(arg1, arg2)) {}
Thinking about it, we've had this discussion at the office several times,
and I've never seen any public discussion on the subject.
While in-between sessions at the Tech-ED in Barcelona, I overheard a
discussion between some developers. The subject of the discussion was code
layout (i.e. how each developer formats and writes code). What are your
takes at the following two examples? Which one would you choose and why?
// may be easier to read for short statements
if (boolean == false) {}
if (DetermineResultFromMethod(arg1, arg2) == false)) {}
or
// easier for longer statements?
if (! boolean) {}
if (! DetermineResultFromMethod(arg1, arg2)) {}
Thinking about it, we've had this discussion at the office several times,
and I've never seen any public discussion on the subject.