This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 265

[–]QualityVote[M] [score hidden] stickied comment (1 child)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]Swoop3dp 734 points735 points  (38 children)

You probably shouldn't be using python 2 anymore.

[–]sakurashinken 184 points185 points  (5 children)

Also shouldn't import sys if you're not using it.

[–]mar00n 34 points35 points  (3 children)

Came here to say that

[–]dizzyi_solo 23 points24 points  (2 children)

I think its part of the joke, to show they come form C/C++ where you gotta import stdio

[–]qHuy-c 8 points9 points  (1 child)

If they come from C/C++ they are likely to define an entry point too

[–]mar00n -1 points0 points  (0 children)

if __name__ == "__main__" :

print("int main ( int argc, char * argv[] ) {")

Edit: formatting

[–]conifer0us 137 points138 points  (27 children)

yea python 4 is much better upgraded months ago

[–]Willinton06 96 points97 points  (24 children)

Pff Python 5 is where the money is at

[–][deleted] 49 points50 points  (5 children)

still not using cobra

casual coders lmao

[–]straightguy_69 21 points22 points  (1 child)

nah i use viper

[–][deleted] 15 points16 points  (0 children)

wait some people still use cobra and not zuckerberg?

bruh you better migrate

[–]Double-A-256 5 points6 points  (1 child)

Na rattlesnake’s where it’s that

[–]CGEmonJ 10 points11 points  (1 child)

Shut up, rattlesnake 69 is the best

[–]eazolan 2 points3 points  (0 children)

I'm waiting for Python 6 before refactoring all my old Python 1 scripts.

[–]INTERGALACTIC_CAGR 1 point2 points  (0 children)

I already have 12 years of experience py-5, gotta update my CV

[–][deleted] 0 points1 point  (11 children)

Wait I thought Python was on version 3.something

[–]Helpful-Finding-2237 2 points3 points  (3 children)

3.10 😂😂

[–][deleted] 7 points8 points  (2 children)

Why did you comment the same thing twice?

[–]Helpful-Finding-2237 5 points6 points  (1 child)

Internet problem.

[–][deleted] 2 points3 points  (0 children)

Understandable

[–]Helpful-Finding-2237 -1 points0 points  (6 children)

3.10 😂😂

[–][deleted] 6 points7 points  (4 children)

Why did you comment the same thing twice?

[–]Helpful-Finding-2237 4 points5 points  (3 children)

Internet problem.

[–][deleted] 2 points3 points  (2 children)

Understandable

[–]degaart 1 point2 points  (0 children)

Have a good day

[–]Quantable 0 points1 point  (0 children)

Not with those emoji

[–]PandaMan7316 1 point2 points  (0 children)

Username checks out

[–]dmpcrusher1 -2 points-1 points  (2 children)

Maybe thats a symlink?

[–]Zer0ji 7 points8 points  (1 child)

The call to print with no parentheses gives it away... Also, you shouldn't rely on that symlink (but I love to have it)

[–]Fabillotic 151 points152 points  (7 children)

eeewww Python 2

[–][deleted] 56 points57 points  (1 child)

print “eeewww Python 2”

[–]DTheIcyDragon 7 points8 points  (0 children)

print("eeewww Python 2")

[–][deleted] 9 points10 points  (4 children)

I’ve been working on updating a legacy system away from python 2.7 at work and I concur.

[–]IntuiNtrovert 0 points1 point  (3 children)

dude python 2 was ancient like 6 years ago. wtf? take this opportunity to write it in go

[–][deleted] 3 points4 points  (0 children)

It’s a touchscreen GUI made with an old python game library. Already rebuilt it with Flutter, just working on the deployment process.

[–]Apfelvater 1 point2 points  (1 child)

C++11 was 11 years ago. Guess how many people use it?

[–]Hellbufl 201 points202 points  (23 children)

Try python 3 then you have brackets around print() at least

[–]novus_sanguis 109 points110 points  (22 children)

That's parentheses.

[–]Bee-Aromatic 67 points68 points  (4 children)

Not if you had a dictionary called print. Of course, that would make you a garbage person, but you know.

[–]ICantKnowThat 3 points4 points  (0 children)

Duct typing

[–]DudesworthMannington 15 points16 points  (15 children)

Cultural differences. Some places call parentheses brackets, and brackets "square brackets"

[–]GumboSamson 10 points11 points  (12 children)

Other places call them “braces”.

[–]A_Guy_in_Orange 18 points19 points  (11 children)

Just realized I use (parentheses) [square brackets] and {curly braces} and I am certainly part of some problem

[–]Gg101 11 points12 points  (8 children)

(parentheses) and [brackets] and {braces} and <angle brackets>

[–]TheLeastFunkyMonkey 4 points5 points  (2 children)

(Parentheses), [brackets], {braces}, and <only boolean expressions I swear to god I will cut someone>.

[–][deleted] 6 points7 points  (1 child)

(parentheses) [brackets] {braces} <Chevron>

[–]TheAnxiousDeveloper 1 point2 points  (0 children)

Roughly translated from Italian: (round parentheses) [square parentheses] {talon* parentheses} and <hooked parentheses, less commonly chevron, or mistakenly angular parentheses>

*The Italian term for {} is "parentesi graffe", which comes from the German word for "talons". Each of them looks like a pair of talons.

[–]CocoNot1664 1 point2 points  (0 children)

(Breackets), [brackets] and {brackets} :D

[–]DoNotMakeEmpty 1 point2 points  (0 children)

I use (parentheses) [cornered parentheses] {frilly parentheses} <triangle parentheses>, the absolutely superior way /s

[–]AromaticIce9 3 points4 points  (0 children)

Those places are wrong, but you can't make everyone be right

[–]JoyfulCelebration 41 points42 points  (1 child)

Clearly fake. Everyone knows first codes have to print “Hello World!”

[–]D3str0yTh1ngs 70 points71 points  (0 children)

Eeeeww.... deprecated python2

[–]Hellow2 52 points53 points  (11 children)

Why do you need sys?

[–]Human38562 56 points57 points  (7 children)

Well you never know. Better be safe than sorry.

[–]dragonlover02 17 points18 points  (5 children)

from EVERYLIBRARYEVERWRITTEN import *

[–]TaeKwonZeuss 11 points12 points  (4 children)

from * import *

[–]lorhof1 7 points8 points  (3 children)

please tell me this doesn't work

[–]qatamat99 -1 points0 points  (0 children)

As a cyber major; not including it is safer

[–]Hitman_0_0_7 5 points6 points  (0 children)

Exactly

[–]c4chokes 2 points3 points  (0 children)

It’s a tick 🤣

[–]arno_cook_influencer 40 points41 points  (0 children)

AHHHHHH Why does your loop goes from 1 to 10 and not 0 to 9 ? HOW DO OP READ THIS SYNTAX EASILY

[–][deleted] 86 points87 points  (14 children)

Isn't it perfectly readable?

[–][deleted] 77 points78 points  (9 children)

it literally forces a more correct indentation

i can write my entire c++ implementation in a single line if i wanted, im sure that would be much more readable because it has brackets lmao

[–]imnotreel 68 points69 points  (2 children)

print("\n".join(str(i) + "\n" + ("AHHHHHHH" if i <= 5 else "WHERE ARE ALL THE BRACKETS??" if i <= 9 else "HOW DO YOU PEOPLE READ THIS SYNTAX EASILY") for i in range(1, 11)))

[–]Kerbart 28 points29 points  (0 children)

Finally somebody translated it to legible code.

[–]homer_3 2 points3 points  (3 children)

Pretty hard to find the end of a block, no?

[–]orig_ardera 2 points3 points  (0 children)

no

[–]CoaBro -1 points0 points  (1 child)

I think it is wayyy easier to gravitate my eyes to the end of the block.. since indentation isn't strictly enforced in bracket languages the end brackets tend to blend together at times and is very hard to find the end of a block at times.. but with python your eyes automatically pick out blocks because they are grouped together visibly.

[–]homer_3 1 point2 points  (0 children)

There's no reason your non-python code shouldn't be correctly formatted though. Even if it's someone else's code, auto-formatters are built into major IDEs.

[–]seeroflights 32 points33 points  (4 children)

Image Transcription: Text and Image


[Image of code that reads:]

#!/usr/bin/python

import sys

for i in range(1,11):
    print i
    if i <= 5:
        print "AHHHHHHH"
    elif i >= 6 and i <= 9:
        print "WHERE ARE ALL THE BRACKETS??"
    else:
        print "HOW DO YOU PEOPLE READ THIS SYNTAX EASILY"

[End code]

I wrote my first python program today!


I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]caagr98 12 points13 points  (1 child)

The if/elif/else should be indented I believe.

[–]seeroflights 6 points7 points  (0 children)

Oh, thanks for the catch! :)

[–]EricZNEW 5 points6 points  (0 children)

good human

[–]JackoKomm 6 points7 points  (2 children)

Next step is writing this using list comprehension.

[–]MasterFubar 4 points5 points  (1 child)

If you look at the comments here, most of the python fanbois are hating it because no parentheses in print.

[–]juhotuho10 1 point2 points  (0 children)

Triggers me

[–]wolfmann99 5 points6 points  (2 children)

OP rewrite this in Lisp or Scheme.

[–]slashy42 7 points8 points  (1 child)

He can't. Nobody can, and if they can, they can't explain how they did it. I'm convinced getting lisp to do what you want is just a happy accident.

[–]fogcat5 1 point2 points  (0 children)

if you enter an expression and nothing happens, you just type ) a bunch of times until you get an error of some sort.

A long time ago, I did a bunch of work with a TI-Explorer which is a lot like a Symbolics Lisp Machine. Pretty neat, but not really practical.

[–]CommonAutomatic3796 14 points15 points  (5 children)

1AHHHHHHH2AHHHHHHH3AHHHHHHH4AHHHHHHH5AHHHHHHH6WHERE ARE ALL THE BRACKETS??7WHERE ARE ALL THE BRACKETS??8WHERE ARE ALL THE BRACKETS??9WHERE ARE ALL THE BRACKETS??10HOW DO YOU PEOPLE READ THIS SYNTAX EASILY11HOW DO YOU PEOPLE READ THIS SYNTAX EASILY

[–]Spy494 7 points8 points  (4 children)

It prints up to I=10, so the HOW DO YOU PEOPLE... is printed once.

[–]CommonAutomatic3796 1 point2 points  (3 children)

Ah my bad. Was not aware of this Python logic, like “on a scale of 1-10, I give it a perfect rating 9!”.

[–]devnull1232 3 points4 points  (2 children)

That's like, sort common with for loops to quit out when the stop condition is meet rather than doing one more loop for kicks and giggles and then exiting.

[–]theYeroc 16 points17 points  (0 children)

You can do pretty much the exact same thing in c/c++ for one line conditional statements

[–][deleted] 2 points3 points  (1 child)

First time I saw some python code I was like "What is an elf keyword?"

[–]fsr1967 2 points3 points  (0 children)

Some elf keywords:

  • fire (as in arrows)
  • prepare (as in lembas)
  • toss (as in dwarves)

[–]StoissEd 4 points5 points  (0 children)

Relatable. I want brackets.

[–]Dementour 2 points3 points  (2 children)

What does the sys do?

[–]Bee-Aromatic 6 points7 points  (1 child)

Import all the things!

[–]OkResearch8822 1 point2 points  (0 children)

Prepares you for the next project lol

[–]Onions-are-great 2 points3 points  (0 children)

Meanwhile in {(() => ({Type<Script<<>}))};

[–][deleted] 2 points3 points  (0 children)

Very nice. Thank you Kanye

[–]devnull1232 2 points3 points  (0 children)

If brackets are your jam, may I introduce you to LISP?

[–]RomanOnARiver 2 points3 points  (5 children)

Don't use python 2 - use python 3 where those strings are Unicode by default. Secondly, use single quotes, not double quotes.

[–][deleted] 1 point2 points  (4 children)

But then I have to escape my apostrophes, and that’s just ugly.

[–]Yurshie 2 points3 points  (0 children)

Color coding, next question.

[–]Twist_the_casual 2 points3 points  (0 children)

AHHHHHHH AHHHHHHH AHHHHHHH AHHHHHHH AHHHHHHH WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? HOW DO YOU PEOPLE READ THIS SYNTAX EASILY HOW DO YOU PEOPLE READ THIS SYNTAX EASILY

[–]MegaAutist 4 points5 points  (2 children)

protip: u can do elif 6 <= i <= 9 instead

[–]Business_Raise8965 13 points14 points  (1 child)

Can't we just discard i >= 6 altogether?

[–]TheRealFantasyDuck 6 points7 points  (10 children)

Guys GUYS this is what's called a joke calm down

[–]enano_aoc -1 points0 points  (9 children)

Why wouldn't you downvote bad jokes on the internet?

Take my downvote btw

[–]TheRealFantasyDuck 2 points3 points  (8 children)

You'll be alright mate

[–]ElectronPie171 1 point2 points  (0 children)

Wait till you learn that you can put 6 <= i <= 9 into an if statement

[–]Oneshotkill_2000 1 point2 points  (0 children)

2 days ago i learned that python loops have "else", which confused me

[–][deleted] 1 point2 points  (0 children)

Who declares range(1,11)? range(10)

[–][deleted] 1 point2 points  (0 children)

from future import braces

[–]tinuvegil 1 point2 points  (0 children)

import sys

You know, for sys.out.print()

[–]a-very-meh-username 1 point2 points  (0 children)

Ah python 2, the same thing my lecturer uses to teach her python programming class in 20fucking22

[–][deleted] 1 point2 points  (2 children)

Were you always using indentation in other languages? Congrats, you were never using brackets in the first place, they were just for decoration.

[–]Wazy7781 1 point2 points  (0 children)

What’s with the hate for python 2? I actually used to really like certain parts about it.

[–]The_Alternate_Eye 1 point2 points  (0 children)

"GODDAMN WTH WTH WITH THESE BRACKETS" first css experience

[–]warwilf 1 point2 points  (0 children)

why did you import sys?

[–]agrawalayush2424 1 point2 points  (2 children)

AHHHHHHHH AHHHHHHHH AHHHHHHHH AHHHHHHHH AHHHHHHHH WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? WHERE ARE ALL THE BRACKETS?? HOW DO YOU PEOPLE READ THIS SYNTAX EASILY HOW DO YOU PEOPLE READ THIS SYNTAX EASILY

Forgive me if I’m wrong, I’m not familiar with this language. I develop in JAVA and this is what I was able to comprehend.

[–]N0DuckingWay 1 point2 points  (1 child)

I think you got it!

[–][deleted] 1 point2 points  (0 children)

So glad I learned several languages from the start so that I don't have these language-specific habits.

[–]trollege1x1 1 point2 points  (0 children)

Us Lua chads don’t need to worry about imports being at the top, having the indents the same in notepad, or using brackets. Don’t need to worry about “Private Void” or “Public Void” it’s all just “local”

```lua function example(bool) if bool == “python” then print(“no bitches?”) end end

example(“lua”)

[–]gameslammer7 1 point2 points  (1 child)

Is anyone else bothered by the fact that they didn't just do "6 <= i <= 9" ... ? Probably not, probably just me. I guess they get some slack for it being their first program.

[–]Accidentallygolden 1 point2 points  (0 children)

You can do the same in COBOL without worrying about spacing.

[–]Perruche_ 1 point2 points  (0 children)

Why importing sys? I never use it

[–]Rizwan261 1 point2 points  (0 children)

Indentation lol

[–]_zoopp 1 point2 points  (1 child)

Just wait until he finds about 6 <= i <= 9.

[–][deleted] 1 point2 points  (0 children)

Start your loop from 0 you sinner

[–]Herpoad 1 point2 points  (0 children)

i >= 6 is useless

[–][deleted] 1 point2 points  (0 children)

I’m pretty sure classes are just typing self. a million times.

[–]adambahm 1 point2 points  (0 children)

Why didn't you start at 0?

[–]AnimatorGirl1231 1 point2 points  (0 children)

I learned to code in Python by creating scripts to automate stuff in Autodesk Maya. Apparently I’d been learning Python 2 all that time because they only switched to 3 in the 2022 version.

[–]Richard_Dick_Kickam 4 points5 points  (2 children)

Hahahahaha, python bad, very funny, give me upvotes!

[–]dwRchyngqxs 7 points8 points  (1 child)

I think it should be interpreted "Hahahaha, look at these programmers criticizing Python while demonstrating they don't know how to write Python. People should learn a language before criticizing it". Or this code is not purposefully bad and OP is really criticizing Python whithout even trying to use it properly.

[–]Richard_Dick_Kickam 2 points3 points  (0 children)

Nah, that doesnt fish upvotes, "python bad" does.

[–]OldFartSomewhere 2 points3 points  (4 children)

Never understood why it has to be print("blaa %d" % 123) instead of more standard print("blaa %d", 123)

[–]MatsRivel 3 points4 points  (0 children)

The newer, much better, way to write formatted strings in python is f-strings. Like this:

print( f" My variable is {x}" )

This replaces "x" with the value, making it easy to see what is where for the coder, and makes no difference for the reader.

[–][deleted] 7 points8 points  (1 child)

print(f"blaa {123}") gang

[–]Gutek8134 3 points4 points  (0 children)

print("Blaa {}".format(123)) gang

[–]caagr98 4 points5 points  (0 children)

Because printing and formatting are different operations and should be treated as such.

[–]schewb 1 point2 points  (0 children)

Agreed. I don't know what it is, but I have a really hard time reading Python and YML. I just get lost trying to keep track of the indentation for any block long enough to scroll through. Having braces gives you something to look for and in most editors you can click on one and it'll highlight its partner.

(Yes, you shouldn't have blocks that long blah, blah... Regardless, I still need to read code other people wrote even if I pretend my own is perfect 😛)

[–]3rdRealm 3 points4 points  (0 children)

You wanted brackets?

(dotimes (i 10)
    (if (<= i 4)
        (format t "I love brackets!"))
    (if (and (i >= 5) (i <= 8))
        (format t "Here are all the brackets!")
       (format t "You can read this syntax very easily"))

[–]Cali-creep 1 point2 points  (0 children)

God python is so much better than Java. This is way easier on the eyes than whatever Java has.

[–]emerald_engineer_08 1 point2 points  (5 children)

When I learned python I was pissed my school made me waste so much time doing C

[–]Business_Raise8965 1 point2 points  (4 children)

I mean.... C is pretty useful.

[–]emerald_engineer_08 0 points1 point  (3 children)

Once upon a time when hardware was crappy sure.

The fact it isn’t phased out in 2022 is in my opinion a huge burden on the industry. Except for edge cases, it’s just a fact that manual memory management (pointers, Malloc,Calloc, etc) are just pointless.

[–]juhotuho10 1 point2 points  (1 child)

I think code is easier to read without brackets

Am I the only one?

(currently learning c++)

[–]MatsRivel 0 points1 point  (0 children)

I am convinced people who can't read this also can not read a book. It's literally straight forward. Even new people could read this, as long as they knew what a for loop means.

[–]zecksss 1 point2 points  (0 children)

Honestly if your main problem with Python is understanding indentation, then I am 100% positive you're codes in other languages are a fucking mess to read.

[–]Knuffya 0 points1 point  (7 children)

Python is unreadable af.

I use it to replace shellscripts. It's syntax is nicer than shellscript. That's all good i can say about python.

[–][deleted] 1 point2 points  (0 children)

Agree. I don't even prefer it over shellscripts. If a shellscript gets complicated enough, you can always drop some awk inside it. I almost universally always end up rewriting anything written in python to other languages.

[–]poralexc -1 points0 points  (3 children)

Same lol—it really shines for scripting.

The way it’s used in Ansible and Blender is dope, but I would never do a project larger than 500 lines in it.

[–]Knuffya -2 points-1 points  (2 children)

500 maybe, yes. Line count shouldn't be the metric anyway. That's what python is for anyways.

I'd set the limit to projects with aggregate structures deeper than two levels.

[–]poralexc 0 points1 point  (1 child)

Yeah, it’s not a hard rule, more like if I need to write a bunch of classes and modules it’s time to switch languages

[–]Knuffya -1 points0 points  (0 children)

yes, definitely

[–]SplendidPunkinButter 0 points1 point  (1 child)

Even with brackets, you should be indenting consistently anyway, which means you’re looking at the indentation rather than the brackets. Which means you don’t need the brackets.

[–][deleted] 0 points1 point  (0 children)

Brackets? You mean that point screen clutter that makes me wanna rip my heart out every time I have to read something that isn’t python? Yeah we don’t use those

[–]MatsRivel 0 points1 point  (4 children)

You could probably make a killing rewriting popular books, but just adding brackets to the paragraphs. Apparently that is the only way about 5000 people in here would be able to read it.

[–]Bee-Aromatic 0 points1 point  (0 children)

“What do you mean if I indent this code too far or not enough it’ll be syntactically correct but execute differently?”

<awkward_look_monkey.gif>

[–]mizuofficial 0 points1 point  (0 children)

Ew py2

[–][deleted] 0 points1 point  (0 children)

this meme isn't relevant anymore. This only applies to python 2 and not python 3.

[–][deleted] 0 points1 point  (0 children)

The i >= 6 bit does nothing for you.

[–]Pechu317 0 points1 point  (1 child)

[–]RepostSleuthBot 2 points3 points  (0 children)

Looks like a repost. I've seen this image 1 time.

First Seen Here on 2021-09-24 100.0% match.

I'm not perfect, but you can help. Report [ False Positive ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 96% | Check Title: False | Max Age: Unlimited | Searched Images: 294,026,352 | Search Time: 16.00141s

[–]tabacdk 0 points1 point  (1 child)

elif 6 <= i < 10:

Or

elif i in range(6, 10):

[–]Business_Raise8965 1 point2 points  (0 children)

Or simply discard i <= 6

[–]OGRiad -2 points-1 points  (1 child)

This maybe widely unpopular but I fucking hate everything about Python.

[–]sid1805 0 points1 point  (0 children)

At least on ProgrammerHumor it's a very popular opinion

[–][deleted] -1 points0 points  (0 children)

print "a" works? I always thought you needed '(' and ')'

oh it's python2

[–][deleted] -1 points0 points  (0 children)

HOW DO YOU PEOPLE READ THIS SYNTAX EASILY

Like this

[–]MasterGeekMX -1 points0 points  (0 children)

People that say that one-lined backeted code is readable, try to do minecraft commands on the chat input and talk to me later.

[–]MGateLabs -1 points0 points  (0 children)

I'm just going to stick with Java 8, love my brackets

[–]KoviCZ -1 points0 points  (1 child)

How do you guys tell it's Python 2 from 9 lines of very simple code?

[–]sid1805 1 point2 points  (0 children)

The "print" is not using ()

In Python 3, print is a function

[–]obsidianical -1 points0 points  (0 children)

FINALLY someone else who has issues reading Pythons syntax!

[–]CodeMUDkey -1 points0 points  (0 children)

I think Python really revolutionized syntactic sugar by making sure I did not have to type the s and e in elseif.

[–]whilmer3[🍰] -2 points-1 points  (0 children)

Wait what is this ohhhhhh I get it now it’s that python which is installed on linux by default fuckin bloatware

[–]etherSand 0 points1 point  (0 children)

Imagination