[kupfer: 5/11] Manual.rst: Coding style edits
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer: 5/11] Manual.rst: Coding style edits
- Date: Sun, 1 Nov 2009 19:49:33 +0000 (UTC)
commit 8ca79c0710b8cc0d3525459741e14c7530907327
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Sun Nov 1 18:16:26 2009 +0100
Manual.rst: Coding style edits
Documentation/Manual.rst | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/Documentation/Manual.rst b/Documentation/Manual.rst
index d32aa52..83ea230 100644
--- a/Documentation/Manual.rst
+++ b/Documentation/Manual.rst
@@ -238,16 +238,22 @@ editor is set to tabs of size four.) Otherwise, if you want to
contribute to kupfer keep in mind that
* Python code should be clear
-* Kupfer is a simple project. Do simple first.
+* Kupfer is a simple project. Do simple first. [#simple]_
-Sometimes comments are needed to explain the code. How many know the
-``for..else`` construction? Hint: find out what it does in the
-``kupfer.icons`` module::
+Python's general style guideline is called `PEP 8`_, and all Python
+programmers should read it. The advice given there is very useful when
+coding for Kupfer.
+
+.. _`PEP 8`: http://www.python.org/dev/peps/pep-0008/
+
+.. [#simple] Writing simple code is more important than you think.
+ Read your diff (changes) when you are finished writing a
+ feature. Can you make it more simple to read? If you can
+ make it simpler, often a more effective algorithm comes out
+ of it at the same time. All optimizations have a price,
+ and unless you measure the difference, abstain from
+ optimizations.
- for item in sequence:
- ...
- else:
- ...
Living and learning
...................
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]