Re: Pse, help me to understand this code
- From: Neil Cerutti <leadvoice@xxxxxxxxx>
- Date: 31 Oct 2005 14:30:03 +0100
On 2005-10-30, Keith Thompson <kst-u@xxxxxxx> wrote:
> Jordan Abel <jmabel@xxxxxxxxxx> writes:
>> On 2005-10-28, __frank__ <non.scrivermi@xxxxxxxxxxxxxxxxxxxx> wrote:
>>> /*********************************************/
>>> /*/ DAQmx Configure Code
>>> /*********************************************/
>
> Actually, that's not correct. Of the three lines, the first is a
> valid comment. The leading "/*" on the second line introduces a
> second comment, which is terminated by the trailing "*/" on the third
> line.
>
> It's confusing because there's a "*/" on the second line that doesn't
> close a comment (because the '*' is part of the "/*" that introduces
> it), and a "/*" on the third line that doesn't introduce a comment
> (because it's already within a comment, and comments don't nest).
>
> It's horrible style, requiring too much effort by the reader to
> confirm that it's valid, but it's not actually wrong.
>
> Either of the following would be better:
>
> /*
> * DAQmx Configure Code
> */
>
> or
>
> /*********************************************/
> /* DAQmx Configure Code */
> /*********************************************/
Or the fantabulous:
/*********************************************************/
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* DAQmx Configure Code!!! * * * * * * * * * * * * * * * */
/* * * * DAQmx Configure Code!!! * * * * * * * * * * * * */
/* * * * * * * * DAQmx Configure Code!!! * * * * * * * * */
/* * * * * * * * * * * * DAQmx Configure Code!!! * * * * */
/* * * * * * * * * * * * * ** * *DAQmx Configure Code!!! */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*********************************************************/
But seriously, comment decorations are a waste. They add very
little and are a pain to maintain.
/* DAQmx Configure Code */
--
Neil Cerutti
.
- References:
- Re: Pse, help me to understand this code
- From: Jordan Abel
- Re: Pse, help me to understand this code
- Prev by Date: Re: Calendar Program
- Next by Date: Re: Can you recommend any C programming books?
- Previous by thread: Re: Pse, help me to understand this code
- Next by thread: Re: Pse, help me to understand this code
- Index(es):
Relevant Pages
|
|