Re: Tutorial and guidelines: A proposal for better OpenSource code (long message)
From: Bjorn Reese (breese_at_see.signature)
Date: 05/31/04
- Previous message: Bjorn Reese: "Re: Sockets in C: Sender keeps resending packet"
- In reply to: Otto Wyss: "Tutorial and guidelines: A proposal for better OpenSource code (long message)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 May 2004 12:19:00 +0200
On Sun, 30 May 2004 20:07:35 +0200, Otto Wyss wrote:
> Tutorial and guidelines: Coding standards, Naming
Naming, along with indentation, is an emotional topic, and you are
unlikely the establish any kind of inter-project consensus. Having
written several coding guidelines (both open source and commercial)
I have come to the conclusion that the only good rule is: Use the
same style as the rest of the code.
> Rules for choosing good names are rather difficult to specify. But
Indeed they are. If you are seriously interested in this, I suggest
that you look into the work of Derek Jones, and especially the
various studies he refers to. See
http://www.knosof.co.uk/cbook/cbook.html
> In class oriented languages (C++) it's a good idea to make the scope
> visible. Global objects should have a "g_" prepended, class objects
> (members) a "m_" while local object may not have a prefix. Other
If there is a need to signify member variables, I prefer "this->"
because it is built into C++ and every programmer will immediately
know what it means (contrary to having to guess that "m_" is short
for member -- you may think it is obvious, but I have met several
programmers who have been puzzled about the "m_" prefix.)
-- mail1dotstofanetdotdk
- Previous message: Bjorn Reese: "Re: Sockets in C: Sender keeps resending packet"
- In reply to: Otto Wyss: "Tutorial and guidelines: A proposal for better OpenSource code (long message)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|