www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - What do you think about my D style guide? - CLAYTEK_3D_STYLEGUIDE.d

reply clayasaurus <clayasaurus_member pathlink.com> writes:
Hello. I've been working on a project and something that is setting me back
is to have a good consistent style to code with. 

I've created a style guide for myself and am posting it here for comments
and critiques. 

Some of you will have differing opinions on things which may be constructive.
Also, I'm open to any additional ideas.

Thanks all for your time

(see attachment)
(http://svn.dsource.org/svn/projects/claytek/trunk/CLAYTEK_3D_STYLEGUIDE.d)
Aug 01 2004
next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
hungarian notation must die!  ;)

i hate to say it but your style annoys me.  my style would probably be as
equally annoying to you.  which is why i never really saw the point in
universal coding styles, unless there are several people working on the same
project!
Aug 02 2004
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Jarrett Billingsley wrote:

 hungarian notation must die!  ;)
 
 i hate to say it but your style annoys me.  my style would probably be as
 equally annoying to you.  which is why i never really saw the point in
 universal coding styles, unless there are several people working on the same
 project!

My department doesn't seem to be able to agree on a style. Maybe it's time to get together. The only trouble is that there are different code editors around - those that use tabs and those (Emacs) that indent by two spaces. And some of the others' styles are already abominable to me. Like economising on spaces, and making every blank like a comment.... (This is in Fortran 90 - it appears that the one bit of coding style in the department is to use this!) Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 02 2004
prev sibling parent Andy Friesen <andy ikagames.com> writes:
clayasaurus wrote:
 Hello. I've been working on a project and something that is setting me back
 is to have a good consistent style to code with. 
 
 I've created a style guide for myself and am posting it here for comments
 and critiques. 
 
 Some of you will have differing opinions on things which may be constructive.
 Also, I'm open to any additional ideas.
 
 Thanks all for your time

Bear in mind that this is all purely subjective. Sticking with a standard is more important than what precise standard is used. So... I *hate*, loathe, despise, and abhor (in that precise order, no less) variable decorations of all description. Variable names should be unique, beautiful little snowflakes. In particular, locals and parameters are never used far from their declaration anyway. Structs are basically useful for three things: communication with C, value type semantics, and as a speed hack. (remember the first rule of optimization: /Don't/) Keep in mind that the public interface of a class is going to be referred to quite a lot more than its internals: put private things at the end, public at the top. And most importantly: Break your own rules if there's a good enough reason to. The entire point is to write code that's easy to read. -- andy
Aug 02 2004