A few days ago, I had to find out about the Python Style Guide, PEP-8, the hard way (thanks SublimeLinter!). I’m now better at styling my Python, but it always helps having some context behind why you’re doing what you’re doing.
So I’m thankful to StackOverflow responder Mikko Ohtamaa for giving me a little more background about PEP-8 in the comments of my previous blog post. Here is what he wrote:
“Python indeed gives you great freedom with your code formatting. However this inevitably leads to a mess when you need to co-operate with different people and source code from different sources. Thus, PEP-8 was born to address this issue so that all code would look similar and people would feel familiar with any Python codebase. Unlike with Java coding conventions, PEP-8 came long after the creation of Python, so there exist a lot of code doing things differently… but I recommend for all new code to follow PEP-8 (like Django itself does)”
If you are learning Python, but haven’t seen PEP-8 yet, make sure read about it here!