[ntp:questions] Unresolved Symbol

Per Hedeland per at hedeland.org
Tue Aug 21 22:09:30 UTC 2007


In article <46caf8e5$0$232$e4fe514c at news.xs4all.nl> "Maarten Wiltink"
<maarten at kittensandcats.net> writes:
>"Richard B. Gilbert" <rgilbert88 at comcast.net> wrote in message
>news:46CAE7E2.2090009 at comcast.net...
>>> "Aggie" <c.kevin.lam at gmail.com> wrote in message
>>> news:1187653764.667735.309710 at m37g2000prh.googlegroups.com...
>
>>>>    if ((pOpts->pzCurOpt != NULL) && (*pOpts->pzCurOpt != NUL))
>
>> This sounds like one of those cases where the author should really
>> have included the comment /* Check for an empty string */. ...
>
>The code says that already. If you need to take your readers by the hand
>and spoon-feed them the comments because the code itself is a bit chunky
>and hard to swallow... get better readers.

I definitely agree that a comment to that effect isn't needed for anyone
that is likely to be able to do anything useful with the code - in fact
littering the code with comments stating the obvious makes it *harder*
to maintain, since a) you will have trouble finding the comments that
really *are* important for understanding the code (or they won't even be
there with that style), and b) it makes it a lot likelier that the
comments won't get updated along with the code.

However I do think the use of NUL is unwise, having a plain '\0' there
instead would avoid an initial potentially confusing
misreading/misunderstanding (not incidentally, it is only the libopt
code that uses NUL, the "proper" ntp code uses '\0' everywhere).

--Per Hedeland
per at hedeland.org




More information about the questions mailing list