   Suggestions for a style guide
  I just finished making a rough draft for the style guide for my project. Here's the link:http://code.google.com/p/jetblade/wiki/styleGuideExcept that I cannot figure out how to get the forums to capitalize the 's' in style. Everything I put in is automatically lowercased for me. *sigh* This is the first time I've written a guide, and I'd love to get some feedback. What'd I forget to mention? What could be clearer? Which of your favorite style rules have I violated? :) The programming language du jour here is Python, by the way. Any feedback is appreciated.[Edited by - Derakon on June 28, 2009 3:04:56 PM]
  Your first link is broken. It should point to http://code.google.com/p/jetblade/wiki/StyleGuide (URLs are case sensitive).Other than that, I'd point you to rule#0 of C++ Coding Standards - "Don’t sweat the small stuff. (Or: Know what not to standardize.)".   ;  Thanks for pointing out the broken link; I'd actually fixed it earlier, but it looks like every time I put the URL in, it gets changed to a lowercase 's' after submission. How'd you manage to do it correctly? As for rule #0, are there particular areas you'd call out as being too nitpicky?   ;  I'm not a big fan of trying to set extra rules about variable names.  They don't add that much IMO (does 'isDataModified' really tell you anything that 'dataModified' wouldn't have?) and are often just more typing.  I would tend to just say something like "all variables should have descriptive names, except for trivial counters" and leave it at that.   ;Quote:Original post by Speedo_I'm not a big fan of trying to set extra rules about variable names.  They don't add that much IMO (does 'isDataModified' really tell you anything that 'dataModified' wouldn't have?) and are often just more typing.  I would tend to just say something like "all variables should have descriptive names, except for trivial counters" and leave it at that.Without knowing the type of 'dataModified' it's hard to tell whether it is modified data or a flag for whether or not it has been modified. I realize this was just an example, and I agree with you in general, but being explicit has its advantages. Also, mostly unrelated, I like how in Lisp you can use "data-modified?".   ;  I don't see anything wrong with your guide, especially in light of python's dynamic typing, and if you can indicate the type/use of a variable by adding "is" or pluralizing it, then that's a good thing -- I do that even in C++ where typing is static, and using a modern IDE where intellisense is just a flick of the wrist away.Identifier names should, in general, be as descriptive as necessary, their length be damned. At some point, lengthier names can cause problems due to their sheer size, but you're probably talking 20+ characters before I'd even be inclined to bat an eye at it personally.I don't think your rules are too overbearing or onerous at all.   ;  Why not just use PEP8?   ;  The_edd: excellent question! The answer is that I wasn't aware of that document. As it turns out I basically agree with it on all the important points (I'm using a different function naming convention, which I admit clashes with the variable naming convention, and there's a few minor other variances). However, since that's such a huge document, I'll keep the local style guide just to emphasize the important bits, and include a link to PEP 8. Thanks for the feedback, everyone!   