this post was submitted on 05 Sep 2023
1323 points (97.5% liked)

Programmer Humor

19467 readers
15 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 68 points 1 year ago (9 children)

Better than counting curly braces.

[–] [email protected] 48 points 1 year ago (2 children)
[–] [email protected] 28 points 1 year ago (1 children)

Me too, any day. I hate everything where indentation matters. Let me just throw my garbage there and YOU sort it out, you are the fucking computer, not me. You do the work.

So fuck you, YAML! All my homies love JSON!

[–] [email protected] 14 points 1 year ago (3 children)

All your homies hate comments.

[–] [email protected] 6 points 1 year ago

My code also documents itself, of course.

[–] [email protected] 3 points 1 year ago

Yeah Yaml is nicer than json, but I’m not into the Python indenting at all.

[–] [email protected] 2 points 1 year ago

I'm here to spread the good word about JSONC. It is the way and everyone should adopt it in place of JSON wherever possible.

[–] [email protected] 15 points 1 year ago (1 children)

Yup.

Spaces? Tabs? Don't care, works regardless.
Copied some code from somewhere else? No problem, 9/10 times it just works. Bonus: a smart IDE will let you quick-format the entire code to whatever style you configured at the click of a button even if it was a complete mess to begin with, as long as all the curly braces are correct.

Also, in any decent IDE you will very rarely need to actually count curly braces, it finds the pair for you, and even lets you easily navigate between them.

The inconsistent way that whitespace is handled across applications makes interacting with code outside your own code files incredibly finicky when your language cares so much about the layout.

There's an argument to be made for the simplicity of python-style indentation and for its aesthetic merits, but IMO that's outweighed by the practical inconvenience it brings.

[–] [email protected] 1 points 1 year ago

But, nobody ever copies code from Stack Overflow!

[–] [email protected] 27 points 1 year ago (3 children)

Even vim can show you that
^(fucking nano user)

[–] UndefinedIsNotAFunction 14 points 1 year ago (2 children)

There's a joke here about using echo "some python code" > main.py in here somewhere but I can't find it. Imagine I did instead.

[–] [email protected] 11 points 1 year ago* (last edited 1 year ago)

Import python.Joke.ShellProgramming()

[–] [email protected] 9 points 1 year ago

"the punchline is clearly trivial, the set-up is left as an exercise for the reader"

[–] [email protected] 6 points 1 year ago (1 children)
[–] [email protected] 11 points 1 year ago (1 children)

Is mirco a little man sitting on your SSD flipping bits manually as you dictate him?

[–] [email protected] 2 points 1 year ago

No that's macro. Micro is when small gnomes sit inside your HDD and moving the read/write head around manually.

[–] [email protected] 19 points 1 year ago

if you have to count the curly braces I understand why you are a python developer

[–] [email protected] 8 points 1 year ago (1 children)

You don't usually count them. They just have to form a neat diagonal.

[–] Reptorian 3 points 1 year ago

Also, highlighted the way you expect when you click next to braces works too.

[–] [email protected] 7 points 1 year ago
[–] [email protected] 4 points 1 year ago (1 children)
[–] [email protected] 4 points 1 year ago (1 children)

Because Python uses indentation instead of curly brackets, which is why this meme exists. Also jetbrains ide s like pycharm and webstorm do all of this for you.

[–] [email protected] 0 points 1 year ago (1 children)

Even the mosy basic text editors does indentation for you, not even an IDE needed

[–] [email protected] 3 points 1 year ago (1 children)

Not as good as jetbrains does, it automatically does things like realign when you paste things and lots of little things that improve the coding experience by a lot.

[–] [email protected] 1 points 1 year ago
[–] [email protected] 1 points 1 year ago

Have you tried using an auto formatter? Let's you write code however and fixes the structure automatically on save. It's way easier for me to write curly braces then hit ctrl+s than have to select multiple lines manually and tab in and out. I feel the biggest gains I've made in productivity came after I learned to embrace tooling.