Is PEP-8 dead? - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html) +--- Forum: Board (https://python-forum.io/forum-26.html) +--- Thread: Is PEP-8 dead? (/thread-13550.html) |
Is PEP-8 dead? - volcano63 - Oct-20-2018 (in this forum?!) Dear moderation team, Aren't you tired of the herds of camelCase in the demonstrated code? Though I understand that many of member come to the forum - quoting an admin of some Python group Quote:for a quick fix, don't you think pointing out a code that is not PEP-8 compliant should get some priority? Shouting out bad code practices - especially when provided as an advance example - seems like a good idea too. And speaking of tabs .... RE: Is PEP-8 dead? - snippsat - Oct-20-2018 (Oct-20-2018, 09:39 AM)volcano63 Wrote: Aren't you tired of the herds of camelCase in the demonstrated code?Sure,but can not do anything else than mention that camelCase is not okay style in Python. (Oct-20-2018, 09:39 AM)volcano63 Wrote: Shouting out bad code practicesNo need to shout it out,can mention PEP-8,an give example with better code style. A site pep8.org with better CSS layout for PEP-8. RE: Is PEP-8 dead? - volcano63 - Oct-20-2018 (Oct-20-2018, 11:07 AM)snippsat Wrote:(Oct-20-2018, 09:39 AM)volcano63 Wrote: Aren't you tired of the herds of camelCase in the demonstrated code?Sure,but can not do anything else than mention that camelCase is not okay style in Python. Noone usually bothers to. (Oct-20-2018, 11:07 AM)snippsat Wrote:(Oct-20-2018, 09:39 AM)volcano63 Wrote: Shouting out bad code practicesNo need to shout it out,can mention PEP-8,an give example with better code style. "Bad programming practice" is not necessarilly PEP-8 - some glaring examples
Considering that advice to abandon Python 2 is given freely, I find it strange that noone bothers to help educate newbies in Python do not s. Sometimes not for the sake of the poster (who may be quite a PITA about accepting constructive criticism), but for the sake of another newbies who do not know better.
RE: Is PEP-8 dead? - snippsat - Oct-20-2018 (Oct-20-2018, 11:26 AM)volcano63 Wrote: I find it strange that noone bothers to help educate newbies in Python do nots.That not right i and others have mention problem you take up here in a lot of Threads. We have a tutorial about it [Basic] Naming Conventions (PEP 8). RE: Is PEP-8 dead? - ichabod801 - Oct-20-2018 I am opposed to the moderation team enforcing PEP-8 in any way. PEP-8 is a style guide, not the style guide. Guido has clearly stated that it was not meant to be the be-all end-all for all Python coding. It was only meant as the style guide for the code in the standard library, and not even all of that meets the strict definition of it. And as PEP-8 says, "Consistency within a project is more important" than consistency with PEP-8. Among other things, I think that means that if their teacher is using camelCase, they should be using camelCase. As for bad coding practices, that's up to the users of the board, not the moderation team. I often do it when dealing with newbies. I don't always detail all the problems, especially in larger bits of code, but rather the things that pop out at me. I can read camelCase fine, and I would be quite happy if no one on this board ever pointed out that posted code was not PEP-8 compliant. RE: Is PEP-8 dead? - volcano63 - Oct-20-2018 (Oct-20-2018, 02:06 PM)ichabod801 Wrote: And as PEP-8 says, "Consistency within a project is more important" than consistency with PEP-8. Among other things, I think that means that if their teacher is using camelCase, they should be using camelCase. Well, newbies are so much into established projects . As about so-called "teachers" - I have heard many complains about quickly-retrained instructors teaching un-Pythonic habits - besides un-Pythonic style. As usual, I have probably wasted my breath. Moderation can be about teaching the Python way... I should pobably just shut up and keep expanding my ignore list RE: Is PEP-8 dead? - buran - Oct-20-2018 Even in the main python documentation there are examples of code that is not PEP8/best practice compliant. I don't think we have to enforce PEP-8. I always mention when the code under discussion is not PEP8 compliant, but I have nether the time nor desire to correct everything. Also sometimes code under discussion is so non-pythonic that CamelCase is the least of problems. Finally, as PEP8 states Quote:Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project. RE: Is PEP-8 dead? - wavic - Oct-20-2018 I don't think about pep-8 at all. I don't even care about it too much. All I care about is to write readable for me and the others code. This is enough to fit into pep-8. Btw, Reymont Hettinger has something to say about this: https://www.youtube.com/watch?v=wf-BqAjZb8M RE: Is PEP-8 dead? - metulburr - Oct-20-2018 (Oct-20-2018, 02:06 PM)ichabod801 Wrote: I am opposed to the moderation team enforcing PEP-8 in any way. PEP-8 is a style guide, not the style guide. Guido has clearly stated that it was not meant to be the be-all end-all for all Python coding. It was only meant as the style guide for the code in the standard library, and not even all of that meets the strict definition of it. And as PEP-8 says, "Consistency within a project is more important" than consistency with PEP-8. Among other things, I think that means that if their teacher is using camelCase, they should be using camelCase. (Oct-20-2018, 03:32 PM)wavic Wrote: All I care about is to write readable for me and the others code. This is enough to fit into pep-8.I think these posts hit the nail on the head of my opinion as well. However one thing that drives me nuts is when people use something other than 4 space indentation (especially the 1,2, or 3 spaced indents). I usually will mention to them about pep 8. But that does not mean i would invoke a rule that you have to post 4 spaces to be allowed to post here. the only thing i think mods be required to do is maintain a friendly environment, remove spam, and make posts easier to read (at least informing users to put their code in code tags, if not do it for them, fix bad titles, etc.). (Oct-20-2018, 09:39 AM)volcano63 Wrote: don't you think pointing out a code that is not PEP-8 compliant should get some priority?I do think our tutorials should be PEP 8 complaint, but that is just my opinion. And especially if the person asks how to make their code better. RE: Is PEP-8 dead? - nilamo - Oct-25-2018 I think most of the code I share follows pep8, with the exception of list comprehensions doing side effects (I'm an offender on that one). I feel that it's more important to offer a friendly atmosphere, so people are more likely to come back the next time they need help (instead of jumping ship to something like Rust, which has an absolutely incredible community). To that end, I don't personally view pep8 comments as incredibly constructive, unless their code has gotten large enough where it's actively difficult to understand. ...or every variable is a single letter, in complex calculations that are completely without description (that really grinds my gears lol) |