PEP8 style controversy

PEP 8 — Style Guide for Python Code.

What is this PEP thing?

It stands for Python Enhancement Proposals (PEPs) and they describe the way python language evolves, by providing a reference point for the ‘pythonic way’ to write code. There is whole list of them. This link contains the index of all Python Enhancement Proposals with numbers assigned by the PEP editors, and once assigned are never changed.

 

My PEP8 rant

In theory those rules are for greater good: readability and consistency. Most of them are very helpful to understand how should like beautiful code. Bu there is one thing that forced me do stop blindly following those guidelines. This is maximum line length of 79 characters (docstrings or comments are limited even further to 72).

I would understand it in other programming languages which structure isn’t based on indention. Also the justification of picking that arbitrary number is ridiculous:

“makes it possible to have several files open side-by-side, and works well when using code review tools that present the two versions in adjacent columns…”

Come on, this your may concern? Now days you can plug-in two or more 4k monitors where you can fit ‘wide’ code.Who cares if you would like to stick with your little MacBooks.

 

How others trying to achieve this?

  1. Use shorter variable names.
  2. Break the line in some arbitrary chosen place or even worse automatically by editor.
  3. Switch to two space indentation instead of recommended four.

Is worth of being complaint? You know the answer…

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I agree to have my personal information transfered to MailChimp ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Leave a Reply