Editing My Python Coding Conventions

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
= Coding Conventions Etc. =
 
= Coding Conventions Etc. =
  
In reading my code it may be of some use to know what conventions I have ( tried ) to follow.  The code has been developed over quite a period of time so the standards are not uniform.  What I write here are the standards that are in quite a bit of the code and the directions that I am trying to move.  In all of the coding consistency is an important standard, I have a ways to go. I am now only coding in Python 3.6 or up. Here are some types of conventions.  Ultimately if you want to understand the code, read it.  I work hard to make it readable, so please try, you can let me know of shortcoming, but note that I am aware of the fact that it still need improvement.  You also might be interested in [[Russ Python Tips and Techniques]].
+
In reading my code it may be of some use to know what conventions I have ( tried ) to follow.  The code has been developed over quite a period of time so the standards are not uniform.  What I write here are the standards that are in quite a bit of the code and the directions that I am trying to move.  In all of the coding consistency is an important standard, I have a ways to go. I am now only coding in Python 3.6 or up. Here are some types of conventions.  Ultimately if you want to understand the code, read it.  I work hard to make it readable, so please try, you can let me know of shortcoming, but note that I am aware of the fact that it still need improvement.
  
 
== Names ==
 
== Names ==
Line 17: Line 17:
 
* Ideas about code modifications for speed, enhancement .... !! marks an idea with high commitment ?? for one that is just an idea.
 
* Ideas about code modifications for speed, enhancement .... !! marks an idea with high commitment ?? for one that is just an idea.
 
* Dead code that I want for reference for at least a while.
 
* Dead code that I want for reference for at least a while.
* Commented out code that might be useful for debugging: # will appear in column 1.  Not maintained so may or may not work.
+
* Commented out code that might be useful for debugging: # will appear in column 1.
 
* As usual always be skeptical about comment content.
 
* As usual always be skeptical about comment content.
 
Comment in column 1 is often for debugging while other comments, indented, end of line, or triple quotes are more often documentation.
 
  
 
== Docstrings ==
 
== Docstrings ==
I am working towards using them but have not arrived at a format that I both like to read and which is quick enough to write.  Not good as of 2019 Jan
+
I am working towards using them but have not arrived at a format that I both like to read and which is quick enough to write.  Not good as of 2017 Jan
* Function docstrings may say '''what it says''' if I think the function name is pretty much and explanation.  Especially if the function is short.
 
  
 
== Imports ==
 
== Imports ==

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)