Style | Course Readings | 6.101 Fall 2022
People often refer to "good style" when talking about programs/code, but, interestingly, that word can mean a lot of different things depending on context. In this document, we'll try to explain what "good style" means in the context of 6.101, as well as to provide some suggestions for incorporating elements of "good style" into your own programs. One notion of style relates to detailed character-by-character desisions about how code is formatted, like how much whitespace to use when indenting, where parentheses should go, etc. The Python Software Foundation does publish/maintain an official style guide called PEP 8, and this convention is probably the most widely-used style convention for Python code, so it's not a bad idea to get into the habit of following those guidelines. That said, while conventions related to this notion of "style" are perhaps worth knowing and caring about, we are not going to focus on them in 6.101 (you are welcome to put your parentheses wherever you like so
Style | Course Readings | 6.101 Fall 2022 Course Notes: Style this page (from a previous semester) is no longer accessible, except for staff
related reading
- styleguide | Style guides for Google-originated open-source projectsgoogle.github.io
- PEP 8: The Style Guide for Python Codepep8.org
- PEP 8 – Style Guide for Python Code | peps.python.orgpeps.python.org
- Code Style — The Hitchhiker's Guide to Pythondocs.python-guide.org
- CSC 151 - Code Formatting and Styleeikmeier.sites.grinnell.edu
- What is "good taste" in software engineering?seangoedecke.com
- Clean up your code: How to create your own C# code styleblog.unity.com
- The Clojure Style Guideguide.clojure.style
- 9. Classes — Python 3.14.6 documentationdocs.python.org
- Google Style Guidesgoogle.github.io
- General Information & FAQweb.mit.edu
- Functional Programming | Course Readings | 6.101 Fall 2023py.mit.edu