| The whole point of these coding standards is that a name such as
OPARMS should never be used. The meanings of types should be obvious
to the uninitiated. Something like "PerformanceParameters" should be
enough. (What does "O" mean here, anyway?) If that isn't clear enough,
please suggest something that is. The amount of typing involved should
not be a factor, although names longer than 31 characters should not
be used.
One of the basic principles of coding to standards is to define things
as little possible. If you don't need to define it, don't define it.
If you do need to define it, define it in one and only one place.
Therefore, if you can define it just by naming a type, do that. If you
have to name a type and then comment it, that's two definitions for
the same thing. Invariably, in my experience, and evidently in the
experience of the critical systems programmers, some of these multiple
definitions drift apart, and then it's just not clear what's really
supposed to be happening.
This is also the real reason for using something like Doxygen -- if
you have to explain what a type does, do it in one and only one place.
Since we do have to do that sometimes in comments, then let us do it
only in comments.
Please note, as I said at the very top of the document, I'm NOT
proposing renaming everything in Csound. This proposal is for new
code.
Although, if everything were renamed as clearly as possible, we would
all probably learn a great deal...
Regards,
Mike
On Wed, May 9, 2012 at 12:00 PM, Steven Yi wrote:
> I like 80 characters per line personally, but I also like using big
> fonts these days, and my main monitor is 13" on my Macbook, so not a
> gigantic monitor.
>
> I think using Doxygen is great for the public API. Otherwise, I think
> comments should be judiciously used, where a function name or member
> variable name isn't enough to understand its intended usage. I guess
> it's a matter of documenting with the intended audience of someone who
> hasn't looked at the code before (i.e. I might not know what an OPARM
> is, or an OPDS, just by its name).
>
> steven
>
> On Wed, May 9, 2012 at 11:43 AM, Michael Gogins
> wrote:
>> No tabs, I agree.
>>
>> You may find doxygen useless, but I use it all the time for Csound.
>>
>> Regards,
>> Mike
>>
>> On Wed, May 9, 2012 at 11:38 AM, wrote:
>>> May I disagree? My laptop does not really allow more than 80 characters
>>> wide and on my desktps I never go wider than 85 characters. I need the
>>> screen scape for other stuff. All C code in Csound fits in my screen. (no
>>> idea on C++ which i usually ignore). Wide pages are not efficient to
>>> read, with the problems of left-right alignment, as is well known in
>>> books.
>>>
>>> And while we are at it -- no tabs as different systems interpret them
>>> differently.
>>>
>>> I would also say no to doxygen which in my experience is totally useless
>>>
>>>> On 09/05/2012 15:52, Felipe Sateler wrote:
>>>>> On Wed, May 9, 2012 at 10:45 AM, wrote:
>>>>>> Letter sized oaper? Why not international standard like A4?
>>>>>
>>>>> Also, at what font size? Does anyone still read printed code? Seems
>>>>> like a waste to not be able to use the available screen real estate.
>>>>> Moreover, descriptive variable and function names always ends up
>>>>> clashing with the 80-column rule (or its variants).
>>>>>
>>>>
>>>> And especially these days when just about everyone has wide-screen style
>>>> displays, rather than the old 5:4 ratio screens, we have far more width
>>>> available then depth. Any standard that does not recognise such changes
>>>> is somewhat out of date. Even DOS console windows can be resized these
>>>> days.
>>>>
>>>> Richard Dobson
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> http://www.michael-gogins.com
>> Michael dot Gogins at gmail dot com
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
--
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |