comparison doc/v2_planning/coding_style.txt @ 1070:79eb0016f333

coding_style: Added a couple points to debate
author Olivier Delalleau <delallea@iro>
date Fri, 10 Sep 2010 10:28:51 -0400
parents 4f287324a5ad
children 04bbf05d249c 3e7978201ffc
comparison
equal deleted inserted replaced
1069:16ea3e5c5a7a 1070:79eb0016f333
196 Yes No 196 Yes No
197 --- -- 197 --- --
198 key in my_dict my_dict.has_key(key) 198 key in my_dict my_dict.has_key(key)
199 sub_string in my_string my_string.find(sub_string) >= 0 199 sub_string in my_string my_string.find(sub_string) >= 0
200 200
201 * (Point to debate) Avoid contractions in code comments (particularly in
202 documentation): "We do not add blue to red because it does not look
203 good" rather than "We don't add blue to red because it doesn't look
204 good". I mostly find it to be cleaner (been used to it while writing
205 scientific articles too).
206
207 * (Point to debate) Imperative vs. third-person comments. I am used to the
208 imperative form and like it better only because it typically saves one
209 letter (the 's'): "Return the sum of elements in x" rather than
210 "Returns the sum of elements in x".
211