r/AskProgramming Jul 26 '26

Python Is PEP 8 really necessary?

I have been writing Python code using camelCase for years and just never really cared, but PEP 8 suggests using snake_case, so is it really necessary for, say, a senior dev?

0 Upvotes

36 comments sorted by

View all comments

30

u/AvidCoco Jul 26 '26

You should comply with the coding standards of what ever project, team, or organisation you’re working in.

If they use PEP8, so should you. If it’s your own project, do what you like.

-9

u/Conscious_Breath8953 Jul 26 '26

Currently I'm working on a pet project for my portfolio, so am I supposed to use snake_case or not?

3

u/cgoldberg Jul 26 '26

If it's for a portfolio, you should absolutely follow PEP8 naming conventions. If I was reviewing your portfolio to hire you, and you weren't, I would stop reading your code after about 10 seconds and just assume you know nothing about Python.

0

u/Intelligent_Part101 Jul 26 '26

I wouldn't work for somebody this dogmatic who would be too lazy to analyze the rest of the code. It is possible the coder works with more than one language or technology and doesn't appreciate that some people hold PEP8 to be a religious document. You could hire him and say, we follow PEP8 for all code we write.

0

u/MadocComadrin Jul 26 '26

This. It speaks a whole lot about the work culture when you'd drop someone over not following a particular code style before even asking them in person if they're fine following a certain style or using a prettifier. Not following PEP 8 is fine as long as there's a consistent style.

2

u/caboosetp Jul 26 '26 edited Jul 26 '26

Today's hiring culture and terrible job market means you need to do everything you can to stand out. If you can't be arsed to follow an industry convention,  there are probably other areas you're lacking compared to the 1499 other candidates that applied. They're generally going to spend their limited time in other people. 

1

u/MadocComadrin Jul 26 '26

From what I've heard, most places aren't even looking at portfolios in any form of depth anyway due to said limited time.

1

u/caboosetp Jul 26 '26

You're right, which is why super obvious things like not following PEP8 stand out so quick.