1317
Brace Style (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] Fillicia@sh.itjust.works 77 points 2 years ago
[-] mariusafa@lemmy.sdf.org 36 points 2 years ago

Literally me every time I want to program something slightly complex in Python.

[-] gofsckyourself@lemmy.world 21 points 2 years ago
[-] Fillicia@sh.itjust.works 25 points 2 years ago

YAML makes you appreciate Python's 4 spaces indentation.

[-] victorz@lemmy.world 13 points 2 years ago

I thought python allowed whatever indentation you wanted as long as it's consistent?

[-] Fillicia@sh.itjust.works 20 points 2 years ago

pep8 calls for 4 space but it is a guidance not a rule.

Google internal style guide recommend(ed?) 2 spaces to accomodate the line length limit.

[-] zalgotext@sh.itjust.works 10 points 2 years ago

It does, but most style guides and autoformatters will use 4

[-] HK65@sopuli.xyz 11 points 2 years ago

Python is one of the few languages with an official style guide, I think that guide says 4 spaces.

[-] northendtrooper@lemmy.ca 5 points 2 years ago
[-] nexussapphire@lemm.ee 11 points 2 years ago

I've set tabs to four spaces in vim because who the fuck defaults tab to eight spaces. That shit looks alien and pushes text off the screen fast.

[-] ulterno@lemmy.kde.social 4 points 2 years ago

I set my clang-format to tabs only (actual tabs ASCII 0x9, no alignment and there is a continuation tab instead), then anyone can set their editor to whatever tab length they feel like and look at their code however they want.

But no spaces on the left of my code. This is for C, C++ and JSON.

[-] sukhmel@programming.dev 5 points 2 years ago

4 tabs is a bit overboard, don't you think?

[-] Simulation6@sopuli.xyz 1 points 2 years ago

4 spaces? Hard core Python programmers must have a callus on their thumbs.

[-] BeardedGingerWonder@feddit.uk 6 points 2 years ago

Just assign tab to 4 spaces.

[-] user224@lemmy.sdf.org 6 points 2 years ago* (last edited 2 years ago)

Mmmm, perfectly level.

[-] Kojichan@lemmy.world 2 points 2 years ago

I'd love to see your .editorconfig.

...

...

What's that in your project root? ...pom.xml? Misread that at first as porn.xml.

[-] Fillicia@sh.itjust.works 2 points 2 years ago

I'm not the OG on this, just an old reddit post I remembered

https://old.reddit.com/r/ProgrammerHumor/comments/9fhvyl/writing_yaml/

[-] 0ops@lemm.ee 1 points 2 years ago

porn.xml

If I had a nickel every time I read it like that

[-] bitwolf@lemmy.one 1 points 2 years ago* (last edited 2 years ago)

But yaml forces the indentation

this post was submitted on 28 Jul 2024
1317 points (99.0% liked)

Programmer Humor

31779 readers
382 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS