You are viewing a single thread.
View all comments
68 points

Better than counting curly braces.

permalink
report
reply
19 points

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

permalink
report
parent
reply
48 points

I’ll take the curly braces

permalink
report
parent
reply
15 points

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.

permalink
report
parent
reply
1 point

But, nobody ever copies code from Stack Overflow!

permalink
report
parent
reply
28 points

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!

permalink
report
parent
reply
14 points

All your homies hate comments.

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
2 points

yep.

permalink
report
parent
reply
8 points

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

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
7 points

parentheses

permalink
report
parent
reply
27 points

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

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
6 points

Obligatory mirco is better.

permalink
report
parent
reply
11 points

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

permalink
report
parent
reply

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.

permalink
report
parent
reply
9 points

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

permalink
report
parent
reply
11 points
*

Import python.Joke.ShellProgramming()

permalink
report
parent
reply
4 points

Why not both

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
0 points

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

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 5.3K

    Monthly active users

  • 1K

    Posts

  • 38K

    Comments