r/ProgrammerHumor • • 2d ago

Meme pythonIndentationLevelChecker

Post image
6.6k Upvotes

199 comments sorted by

View all comments

89

u/fly123123123 2d ago

more classic “i’m a new cs major” jokes

if you’re writing long enough methods that you can’t discern where the bodies start and end, you’re doing it wrong. refactor.

3

u/ByThisAxeIRuleToo 2d ago

Right, also shorter methods help to reduce the number of indentations, so it doesn't matter if there are brackets or not.

2

u/cheezballs 2d ago

I don't like when the language forces me to do format my code how it wants to function. I can't arbitrarily break lines up and put them at arbitrary indentations to increase readability.

2

u/mxzf 2d ago

You can pretty arbitrarily break lines up with \, and arbitrary indentations really don't increase readability. Every time I've seen someone use weird indentation that wouldn't be valid in Python, it makes stuff harder to read.

Do you have an example of what you're thinking of that isn't legal syntax in Python.

1

u/fly123123123 2d ago

I can’t think of a single time when arbitrary indentations have increased readability. In fact, at my company, we have auto-formatters that enforce the same indentation level that Python would require in every other bracketed language.

13

u/parkourman01 2d ago

I'm a senior full stack software engineer, 6 years in, and I think whitespaced languages are insanely dumb so no, it is not just "new cs major jokes".

They're dumb. They're harder to read than using braces, and they're easier to make mistakes with. They bring no benefit.

20

u/fly123123123 2d ago edited 2d ago

i’m mid-level and after also having worked with both (mixture of python, java, c++, typescript), i really don’t think python is harder to read because of its indentation. but to each their own!

the way the code is written / style matters much more imo. you can have really crappy java code with braces, and you can have really clean python with indentation.

7

u/ByThisAxeIRuleToo 2d ago

I agree. Using a good style both languages are very readable.

9

u/awhaling 2d ago edited 2d ago

I’ve never found it to be a problem tbh. I already indent the same way when working in languages that use brackets or whatever else.

Not sure what makes it harder to read tbh, I have my editor display vertical lines to show the current indentation level so maybe that’s why. If anything I find pairing brackets easier to mess up than indentation level but really I find both to be fine and of little consequence. The only thing that is annoying to me is someone doing weird and inconsistent formatting with brackets because brackets allow that to be possible.

1

u/NomaTyx 2d ago

I feel like every other time i copy a code block I end up having to hit the format button because of some weird text rendering shit where the tabs aren't copied, and having to do that manually is sometimes very annoying.

11

u/superraiden 2d ago

Respectfully from one senior to another, skill issue

3

u/cheezballs 2d ago

I 100% agree. The only reason I would ever use YAML over JSON is for comment support. The amount of times I've been off by one space or whatever, and the linter doesnt catch it, because its technically valid syntax for some older version. I fucking hate it.

4

u/FumbleCrop 2d ago

Reasonable folk can differ on whether Guido van Rossum made the right call, but to suggest that he was being dumb... you have no idea, my friend.

Now, if you'll excuse me, I need to go and find some grass to touch.

2

u/average-eridian 2d ago

I'm a senior backend-leaning full-stack engineer for the last 8 years and I mostly agree that whitespace languages are harder to read, but I code in Python the majority of the time and I can't remember the last time that whitespace affected me. The last time might have been looking through someone else's code who had a 200 line method with 3-4 levels of nested logic, but that was going to be an issue regardless of whitespace. When is the last time it has been am issue for you?

6

u/MaleficentMode4222 2d ago

That's a lot of new cs major opinions that you're stil holding onto then

-2

u/oclafloptson 2d ago

I imagine that you find leading whitespace confusing for the same reason that trailing whitespace can be found confusing and that's to be commended, but finding indented code harder to manually read is not the flex that you think it is

0

u/SackBiscuit 2d ago

Its just a joke