Some Context Behind Python Style Guide PEP-8

12 Sep

A few days ago, I had to find out about the Python Style Guide, PEP-8the 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!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s