edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] [patch] Parenthesize assignments used as a truth...
@ 2014-08-08 11:52 Karl Dahlke
  2014-08-08 18:07 ` Adam Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Dahlke @ 2014-08-08 11:52 UTC (permalink / raw)
  To: Edbrowse-dev

if(t = strchr(line, '@')) {

I have to admit I am a bit hesitant about adding in the extra parentheses

if((t = strchr(line, '@'))) {

and not because of any screen reader.
Rather the parentheses add almost no new information.
They don't make clear the order of operations.
There is no parsing ambiguity.
The line can only run as it runs.
Unlike some of the lines with many operators,
especially the shift and booleans, where the C precedence is really
quite counterintuitive.
Or the ?: with other stuff going on.
I can see adding parentheses to those for clarity.
But to me lines like this seem perfectly clear.
And 2 extra chars, or perhaps 4 after you run indent,
well, if the line is inside some blocks,
4 more chars could push you over 80 and then the damn indenter cuts the line in two,
and then you're reading the logical line of code across two physical lines.
Now that is annoying.
Oh I know, at this point you tell me I have too many
nested blocks, and yeah you might be right,
but it is what it is.
There are a couple of places where it's almost criminal what indent does.

if(z ==
23 ||
y ==
37 ||
q == 1 &&

etc all tabbed over to the right.
Makes me wish I'd stayed with my original 4 space indent instead of the linux kernel
standard 8 space indent.
Or maybe it's what I deserve for nesting 5 blocks.
Anyways I'm a little off topic.
I'll probably hang on to this patch and not push it now,
unless everyone else unanimously thinks I should.

Karl Dahlke

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-08 18:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-08 11:52 [Edbrowse-dev] [patch] Parenthesize assignments used as a truth Karl Dahlke
2014-08-08 18:07 ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).