-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Adam and Michael,

that was exactly what I was after. I sort of thought about that line but was 
not sure.


Cheers,

seb


Adam Kennedy wrote:
> A quick set of three basic guidelines for comments. I find these get
> my through most situations.
> 
> 1. The code says what you are doing, the comments say WHY you are doing it.
> 
> 2. The code is there to teach people who aren't you (which includes
> you-in-12-months) about the code, so in general they should be before
> a block of code, and introduce it.
> 
> 3. Comments are for humans. Don't leave commented out old code around,
> they just mess up the comments, and you should be using version
> control for that anyway.
> 
> Adam K
> 
> 2009/1/12 Sebastian <[email protected]>:
> Hi all,
> 
> recently I've started getting into Python and Django programming as
> well as shell scripting.
> 
> I was wondering is there any rule or guide on good practice on how to
> comment code?
> 
> For me and my current knowledge state, very low I would say :-), I do
> a lot of commenting. sometimes more than one line comments on one line
> code.
> Now I was wondering if I should place the comments before the actual
> code line, after or at the end.
> 
> I like commenting in line after the code as it makes the code more
> easy to read - for me...
> But I like commenting lines preceding the code line as it keeps the
> lines itself short...
> 
> I think that most would say it comes down to personal preference but I
> was wondering at the same time if there are some rules I should get
> used to right from the start.
> 
> 
> Cheers,
> 
> seb
> 
- --
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklrJmQACgkQMuBzgG5z7F/i9QCfVj0wlMswpTGHDv8F8U9BORh1
zOsAoL/qFYi9xZH3Hd7BjeWl+KB0ccIf
=geNm
-----END PGP SIGNATURE-----

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to