“Speaker: Raymond Hettinger Distillation of understanding acquired from a 10 years of Python consulting, Python schooling, code critiques, and serving as a core …


Last update on 2019-10-23 at 08:38 / Affiliate links / Images from Amazon Product Advertising API

49 thoughts on “Raymond Hettinger – Further than PEP 8 — Very best methods for wonderful intelligible code – PyCon 2015”

  1. In strictly typed languages we call all of this refactoring "interfaces." In C# that routing table is an IEnumerable.
    He just found some bad Java code. Java has interfaces too.
    It's possible to write bad code in any language.
    Lack of interfaces in Python just makes it harder to see that you're actually looking at something that could be iterable with a little refactoring.

  2. Enforcing PEP 8 via the pycodestyle tool is great, but I recommend also using pylint for more comprehensive static analysis. The latter is not a replacement for the former.

  3. I never understood why the counting of line lengths doesn't start after the indents, it's not like there is any reason why you would not need to write the same longish lines inside some nested loops or ifs

  4. Many of the issues are non-issues if you use a modern editor with a short feedback loop for linting things. Same goes for code quality in teams, not a very good team if they don't all use the same lint requirements in their editing software – but rather resort to formatting the committed code.

  5. Terrific talk.

    One quibble: Named tuples present a nice API, but I don't like them, and it's not because they use eval. It's because pylint can't see inside them, so named_tuple.almost_speled_right isn't flagged as an error.

  6. 100 char lines with 2 space indents are more readable than 80 char with 4 space indents. Is anyone still stuck with an 80 col screen or printer? I have more cols than that when editing on my phone.

  7. There is one good reason to follow PEP-8 strictly .. IDEs and autoformatting .. I don't care to manually go and reformat files according to any coding standard, even PEP-8, I press a key combo and hit enter, the IDE does it for me .. now if your code doesn't follow PEP-8, it will be changed, line breaks will be added to weird locations etc. .. I could tune my IDE rules so it wouldn't break at 79 chars, but then it would apply everywhere, which I don't want either.

  8. I liked it, have to show it to my Java coworkers. 🙂

    I tend to use double quotes for strings that are in human language and don't affect meaning of the code (such as messages), and single quotes for strings like symbols or computer commands that do affect program semantics.

Leave a Reply

Your email address will not be published. Required fields are marked *