Regarding coding style

Grant Edwards grante at visi.com
Sun Mar 9 00:36:16 EST 2008


On 2008-03-09, Dan Bishop <danb_83 at yahoo.com> wrote:
> On Mar 8, 1:31 pm, Grant Edwards <gra... at visi.com> wrote:
> ...
>> <rant>
>> What I really can't stand are the pointy-haired comment blocks
>> at the beginnings of C/C++ functions that do things like tell
>> you the name and return type of the function and list the names
>> and types of the parameters. Gee, thanks.  I never could have
>> figured that out from looking at the source code itself. IMO,
>> comments explaining what the parameters are used for usually
>> indicates that the parameter names were poorly chosen.
>
> You must work for the same company I do.  I've seen a whole bunch of
> comments that look like:
>
> //---------------------------------------------------------------------------
> // CXyzBase::LogMessage
> //
> //    Write a message to the log.
> //
> //    Args:
> //       strMsg = the message to log
> //
> void CXyzBase::LogMessage(const CString& strMsg)
> {
>    //
> }
>
> And even worse, at the top of that file:
>
> //---------------------------------------------------------------------------
> // XyzBase.cpp
> //
> //    This file contains the implementation of class CXyzBase.
> //
> //    Copyright (C) 2008 Foobar Computer Consulting
> //
> //    VERSION   PROJECT#     DATE     DESCRIPTION
> //    -------   --------   --------   ------------------
> //      1.00     123456    01/04/08   Original creation.
> //
>
> Eleven lines, of which the only useful information to me was the
> project number, as knowing this let me look up who was behind these
> comments.

:)

I'm currently consulting part-time for a company that's very
fond of that sort of thing.  And it's it's not like they're
working on some DoD contract that explicitly requires such
time-wastage -- it's something they torture themselves with of
their own volition.

[I honestly didn't expect my rant to spark such a long thread.]

-- 
Grant Edwards                   grante             Yow!  I will invent "TIDY
                                  at               BOWL"...
                               visi.com            



More information about the Python-list mailing list