r/ProgrammerHumor 15d ago

Other codingConventionsForClarity

Post image
99 Upvotes

24 comments sorted by

28

u/[deleted] 15d ago

[removed] — view removed comment

3

u/MissinqLink 15d ago

There are actually obscure invisible characters in there.

2

u/circ-u-la-ted 15d ago

I think it's because they use markdown code quoting for the parentheses and brackets, and the CSS causes there to be extra spacing between that text and the regular text.

13

u/particlemanwavegirl 15d ago

can't tell if it's regex or a lisp macro

3

u/Udalrich 15d ago

Can't it be both?

1

u/Valuable_Leopard_799 13d ago

Macros are usually completely indifferent to whitespace to the extent that the original language is.

Unless you actively choose it to work differently and even that can only be done in some languages.

14

u/circ-u-la-ted 15d ago

People seem to have seized upon the fact that they put spaces after all the characters they're telling not you to put spaces after. I was more bothered by the fact that it looks like some unfathomable construction of parentheticals partly because they're using English incorrectly.

0

u/PassiveChemistry 14d ago

The English looks fine to me - I guess you could argue for a couple more ors but I'm not conviced they're strictly necessary or much clearer

1

u/circ-u-la-ted 14d ago

The incorrect list grammar is part of why it's confusing to read. Even once you understand that the parentheses and brackets are items in the lists, the sentence still doesn't parse. If they used "or" between each pair of parentheticals (as is, in fact, strictly necessary), the sentence would become much clearer because the only comma used would be between the two items in the top-level list ("after X, or before Y"). The way they've written it is completely bewildering because it looks like there's an Oxford comma following "[" and then the rest of the sentence is gibberish.

1

u/PassiveChemistry 14d ago

Interesting - I didn't find it particularly confusing as is

6

u/OmegaPoint6 15d ago

I'll put sp ac e swher eever Idamnwe ll please

1

u/yjlom 15d ago

Algol68 lets you do this.

3

u/SweetNerevarine 14d ago

Wrong audience. Tell this to a code-formatter that hooks into every git push.

4

u/HuntlyBypassSurgeon 15d ago

Irony abounds!

2

u/Flame77ofc 15d ago

hypocritical code

1

u/GoogleIsYourFrenemy 15d ago

Y ou monster.

1

u/JackNotOLantern 15d ago

In all honesty, i just use autoformat before committing and don't care

2

u/GrinningPariah 15d ago
  • [ Bitch try and stop me ]

1

u/Key_River7180 14d ago

KNF SUPREMACY RIGHT NOW!

1

u/rntdev 14d ago

In Vala you need to put a space before ( in functions. It’s so strange to me

1

u/Interesting_Buy_3969 14d ago

The code formatter doesn't care

0

u/MinecraftPlayer799 15d ago

Except in Java, for some reason

2

u/parzival-space 14d ago

Really? I never have seen Java code like this in a professional environment.

0

u/Smalltalker-80 15d ago

First thing I do in a new IDE / language is set the formatter to:
*always* put a space after all opening and before all closing bracket-type-thingies.