[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #15585 [Tor]: /src/util.c refactoring
#15585: /src/util.c refactoring
-----------------------------+------------------------------
Reporter: arcadiaq | Owner: arcadiaq
Type: enhancement | Status: assigned
Priority: trivial | Milestone:
Component: Tor | Version:
Resolution: | Keywords: refactoring, Tor
Actual Points: | Parent ID:
Points: |
-----------------------------+------------------------------
Changes (by yawning):
* priority: normal => trivial
Comment:
Replying to [comment:3 arcadiaq]:
> > Hmm, there's nothing in the style guidelines forbidding this behavior,
and leaving out braces for single line `if` statements is something done
throughout the rest of the code, so I'm not seeing the point of this
change.
> >
> > Since it's cosmetic and isn't something that's consistent with the
rest of the codebase I'm inclined to NACK this.
>
> Well, that's right, but the readability of the code is way better this
way. Such constructions as
> `if (condition) statement`
> are pretty ugly and I can't see why they should remain in the code. The
style guidelines are too vague and they allow very strange constructions
to remain in the code. The cosmetic changes should keep the code simple
and fancy and get rid of the chaos in the source code.
`if (condition) statement` can be ugly if the statement is more than
something extremely trivial.
{{{
if (condition)
statement;
}}}
Is a common and well established style guideline for a lot of large
projects (See `style(9)` if you are a BSD person, "Linux kernel coding
style" if you are a Linux person).
Anyway, it's up to nickm, but my opinion still stands for the most part
(the two lines where the new line is missing could be changed to add a
newline, though I think `if (TOR_ISODIGIT(*cp)) ++cp;` is perfectly
understandable).
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15585#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs