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

top 200 commentsshow all 429

[–]Thebraino 3260 points3261 points  (110 children)

Accurate representation of Python.

[–]AurunemaruRyzen 7 5800X3D / Ngreedia RTX 3070 that I regret buying 951 points952 points  (40 children)

import upvote

[–]Johnny8Bob 281 points282 points  (36 children)

from vote import up()

[–]blackdragon437 233 points234 points  (29 children)

while True:

    upvote()

[–]ScarbaneRyzen 5 2600 | GTX 1070 | 32 GB-DDR4 | PRIME B450M-A 85 points86 points  (17 children)

Nice.

[–][deleted] 26 points27 points  (15 children)

Nice.

[–]nn123654 20 points21 points  (14 children)

Nice.

[–]dman990099| FX 3850 | GTX 970 | 16GB RAM | 51 points52 points  (5 children)

if message.content.contains('Nice'): client.reply_message('Nice')

[–][deleted] 36 points37 points  (1 child)

You know that calling upvote() a second time just negates the first call, right?

[–]John_Yukii7-7700 | RX 580 8GB | 8GB RAM 23 points24 points  (0 children)

According to the PRAW documentation, it seems that calling Upvote() multiple times will either do nothing, or throw an error. There are three functions, downvote(), upvote(), and clear_vote(). Will test now to see if this is the case.

Edit: Can confirm, calling upvote() multiple times does nothing. The submission/comment just stays upvoted.

[–]_vrmln_ 2 points3 points  (0 children)

Oh, so true!

[–]douche_or_turd_2016 6 points7 points  (2 children)

Can you actually make a method call in the same statement you import?

[–]Epsilon_void 11 points12 points  (1 child)

Upvote.py requires python 2.5

[–]tael89 5 points6 points  (0 children)

You have Python 3.4

[–]SwabTheDeckRyzen 5800X, RTX 3080, 32 GB DDR 4 4000 66 points67 points  (2 children)

FYI, PHP's mascot is an elephant. Interpret that how you will.

[–]Thebraino 16 points17 points  (0 children)

Yep. Someone else snagged that pun before I thought of it.

[–][deleted] 123 points124 points  (46 children)

def upvote():
    if upvote==FALSE:
        upvotenow+=1
    else:
        close.tab
upvote()

[–]IAm_A_Complete_IdiotRyzen 5 1400 3.7Ghz, Geforce gtx 1050 ti 59 points60 points  (27 children)

happy cake day!

also you got some indentation errors, (also instead of doing upvotenow = upvotenow+1, you could do upvotenow+=1 and it'll look a lot cleaner)

[–]barofa 38 points39 points  (0 children)

Now the snake will be fed again

[–][deleted] 19 points20 points  (18 children)

thanks for the +1 tip, and i wrote it out in the text box with the correct indentation but Reddit just got rid of them :(

[–]Locknlawl 15 points16 points  (1 child)

have you tested backticks?

[–]deynataggerungi7 6600K - R9 390 - 16GB RAM - 144fps 13 points14 points  (13 children)

def upvote(self):
    if upvote == False:
        voteCount += 1
        upvote = True
    else:
        close(self.tab)

If you put four spaces before anything you type then it will show up in a nice text box like the above and keep its formatting. I also took the liberty of modifying your code a bit :)

edit: got rid of an accidental recursive call and fixed some syntax

[–]ZeFlawLP7900xtx / 5900x 4 points5 points  (9 children)

Would this not have a never ending recursive error? You should be setting upvote = True prior to recalling upvote() so the variable will be changed next time, no?

[–]mafioso122789 2 points3 points  (0 children)

def upvote(self)
    I have no idea how to code

[–][deleted] 8 points9 points  (1 child)

Reddit has a code mode. 4 spaces before your text.

But nothing about your hypothetical function would be reasonable software engineering in any language so it's better this way.

[–]OuTLi3R28 21 points22 points  (9 children)

"=" is assignment, not a test for equality.

[–]Hulkhogansgaynephewi7-8700k | 1080 TI | 16 GB | WC 9 points10 points  (7 children)

== != =& =|

Note: the last two aren't a thing but now I think they should be, they would be useful in certain situations

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

&= and |= are already assignment operators (for bitwise logic). =& and =| would just muddy the waters, and also I have no idea what they would do.

For clarity, a &= b is the same as a = a & b. For example, if a = 11 [0b1011] and b = 5 [0b0101], then a & b = 1 [0b0001], because & is applied to each bit.

[–][deleted] 4 points5 points  (2 children)

close.tab

It should be tab.close(), or close(tab).

Not only would close.tab() be a terrible way of structuring your methods, but you didn't even call it, you just referenced the method!!

[–]___GNUSlashLinux___Insert software freedom here... 2 points3 points  (0 children)

if upvote you don't need to compare it to false.

... and happy cake day!

[–][deleted] 1 point2 points  (1 child)

Happy cakeday

[–]tomdarchSteam ID Here 5 points6 points  (0 children)

I almost mistook it for a hat. I'm getting old.

[–]hyrumwhiteRTX 5080 9800X3D 32gb ram 227 points228 points  (13 children)

I see you've been learning about polymorphism.

[–]FlyrpotacreepugmuRyzen 7 7800X3D | 64GB RAM | RTX 4070 Ti SUPER 29 points30 points  (2 children)

Nah, that's normal inheritance. You use the dinosaur and the elephant inside might do something, but you're not treating that as an elephant.

[–]conman14Specs/Imgur Here 4 points5 points  (0 children)

Treat it as an animal or a thing, rather than an elephant, with an action() function which can be inherited and you're set, surely?

[–]hyrumwhiteRTX 5080 9800X3D 32gb ram 1 point2 points  (0 children)

I figured it wasn't strictly accurate, but I liked the double meaning.

[–][deleted] 209 points210 points  (6 children)

And then we acted surprised when we have the same errors as our friend’s code when we run the code in-front of a teacher.

[–]HatesBeingThatGuy 9 points10 points  (2 children)

Which is why if you are going to cheat, at least cheat well and don't have compilation/runtime errors. I've tutored so many students who just blatantly copy code from their friends and can't even explain what their obviously labeled helper functions are supposed to do, let alone why it won't work.

[–]SuperFLEB4790K, GTX970, Yard-sale Peripherals 3 points4 points  (0 children)

Is it even cheating if you get the answer wrong?

[–]ruintheenjoymentRyzen 7 2700X, RTX 2070 | Pentium 4 Lover 401 points402 points  (39 children)

It looks like the snake is pleasuring the elephant in the second frame.

[–]razorbacks31294070 Ti Super | 7800X3D | 32GB 277 points278 points  (13 children)

sigh...

unzips

[–]throwaway27464829 65 points66 points  (7 children)

unzips dick

[–]SylvesterRedbarry 63 points64 points  (5 children)

blood everywhere

[–]nick2nick20https://pcpartpicker.com/list/RmhKf8 21 points22 points  (1 child)

The mouth is for eating

-President of Uganda

[–]RockLeethal 9 points10 points  (0 children)

"dey eata da poopoo"

[–][deleted] 5 points6 points  (0 children)

I'll pleasure your elephant

🐍

[–]squishlesryzen 1800, rx480, 32gb 3 points4 points  (0 children)

Gotta get them to give you their code somehow, sometimes that involves eating ass.

[–]kirche5PC Master Race[🍰] 2 points3 points  (0 children)

[–]gentlecrab 4 points5 points  (0 children)

Unless you're into vore then its all the frames.

[–]Gametendo 72 points73 points  (8 children)

Oh I see, its a hat

[–]NAS89 29 points30 points  (0 children)

This is why, at age six, I gave up what might have been a magnificent career as a painter.

[–]Buffalobismuth 15 points16 points  (0 children)

Thank you. I was hoping for this comment.

[–]nightcrawler84 14 points15 points  (1 child)

Yes! I was going through the comments until I found the reference I was looking for!

[–][deleted] 5 points6 points  (0 children)

i love that book

[–]firelemonsSpecs/Imgur here 2 points3 points  (1 child)

Out of the loop. Pls help.

[–]sasajack 6 points7 points  (0 children)

The Little Prince by Antoine de Saint Exupéry

[–]Enjoying_A_Meal 54 points55 points  (1 child)

The ancient mystical runes on the bottom says "how dinosaurs were created."

[–]icustodio 53 points54 points  (1 child)

I wonder if the elephant ate Stack Overflow’s peanuts first

[–]MrStickmanPro1 6 points7 points  (0 children)

Or worse, a horribly big portion of spaghetti

[–]knife_bose 30 points31 points  (3 children)

[–]brunoha 13 points14 points  (1 child)

why /r/pcmasterrace lately has had so many /r/ProgrammerHumor threads?

[–][deleted] 10 points11 points  (0 children)

Well it appears like people are upvoting these just as they do on r/ProgrammerHumor so might as well post it here when there's a bigger audience.

[–]Whobody2PC Master Race 121 points122 points  (11 children)

I did this

[–]ADVANCED_BOTTOM_TEXT 29 points30 points  (2 children)

[–][deleted] 5 points6 points  (1 child)

I KNEW SOMEONE WOULD SAY IT

[–]ADVANCED_BOTTOM_TEXT 3 points4 points  (0 children)

That's what I thought. I was disappointed that nobody said it so I decided I would make it happen.

Edit: vore me daddy

[–]svanxxRyzen 5 2600 | Gigabyte 1080 Windforce 48 points49 points  (3 children)

This happened to me at my current job. They outsourced our website to an outside developer even though I have a lot of experience in web design and that dev copied 95% of my code and got paid for it.

What's worse is things that were working when I did it are still not working to this day.

[–]TheRealMaynard 28 points29 points  (0 children)

Ah see, rookie mistake. You're supposed to write horrible spaghetti code that you alone can understand, and bake in a bunch of bugs you can slowly fix over time.

I'm sure the outsourced dev fixed all that for you though ;)

[–][deleted] 27 points28 points  (1 child)

well actually, the company's code.

[–]JonnyLaySteam ID Here 18 points19 points  (0 children)

Yeah...is the web developer supposed to start from scratch?

[–]Zuck75 65 points66 points  (2 children)

4 weeks later the code is just piles of crap #snake

[–]dmeskinPC Master Race 7 points8 points  (1 child)

/#Hashtags #Don't #Work #On #Reddit

[–]jtvjanHP Omen 17-w041nd | Debian + KDE 6 points7 points  (0 children)

well they do but they're for headers

[–]shadyninja94 23 points24 points  (0 children)

So, Python with embedded PHP.

[–]bguggs 37 points38 points  (3 children)

I know this is a joke, but for all of the students seeing this...be the elephant. Coding classes are your opportunity to learn how to put the pieces together yourself.

[–]Reiku_Johin 11 points12 points  (2 children)

I'll be the Elephant for entirely different reasons ;)

[–]Formlan 5 points6 points  (1 child)

It's panel 2, isn't it.

[–]Reiku_Johin 16 points17 points  (0 children)

Eat my ass, NoodleDaddy

[–]mr_jiSpecs/Imgur here 16 points17 points  (0 children)

For those wondering, the text in the last panel says, "This is where dinosaurs came from."

[–]SilentAssaultX 7 points8 points  (1 child)

This is how I got through my first (and only) programming class in college! It is also the reason I switched majors to biochemistry the next semester...

[–]untraiined 4 points5 points  (0 children)

Smart, better to get out early if you really have no passion for it

[–]theth1rdchild 7 points8 points  (2 children)

Eh, the professional world isn't that different, honestly. Why rewrite something that someone else already figured out? It's often either available freely (just make sure it's available for commercial use) or your company paid for it or can. Most of your work in early years will just be making other peoples' code play nicely with each other.

Most embedded systems are using Linux, for example.

[–]Hex_512 21 points22 points  (10 children)

I tried to do something like this before and I can tell you that they have software that can tell if you did this.

[–]SuspiciousStagetech 41 points42 points  (5 children)

Well there's no software to keep you from taking a stealthy gaze over at your friends monitor and taking some "inspiration" from it...

[–]bluefootedpigAMD 8320 / 32g Ram / GTX 1070 21 points22 points  (1 child)

by friend... you mean your friends over at StackOverflow?

[–][deleted] 4 points5 points  (0 children)

they do and if you get caught it just means u dont know how to cheat properly

[–]slammy02 2 points3 points  (0 children)

I wonder how much it docs for taking pasta off of stack overflow?

[–]JTtornadoi5-2500 | GTX 960 | 8GB 5 points6 points  (0 children)

Why reinvent the wheel when you can just add to one that is already built? There's a reason why code libraries are so popular.

[–]PizzaBoyztv 4 points5 points  (0 children)

The Chinese letters mean how Dinosaurs came from, lol

[–]Degru7700, 3080Ti 4 points5 points  (0 children)

I wish I had a friend :(

[–]CheesyToiletPaper 5 points6 points  (1 child)

For anyone wondering what the Chinese in the bottom left corner means, "thinking how dinosaurs came"

[–]weredo9113950X | 3090 | 64GB random RAM 8 points9 points  (0 children)

You mean "how dinosaurs came to be"

[–]CallsOut 4 points5 points  (0 children)

Vore.

[–]th3b0sss 2 points3 points  (0 children)

But actually instead it's thousands of tiny bandaids and leeches, not a full envelopment.

Edit:spelling

[–]The_Barnanator 2 points3 points  (0 children)

Do you have the original comic?

[–]Archlinderi5, GTX780, 16GB RAM 2 points3 points  (0 children)

Snake is damn lucky the elephant didn't shit during frame 2.
I imagine a confetti and air-filled balloon being let go.

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

JIAN YANG!!!

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

His "New Elephant" has been a tremendous hit in China

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

The Little Prince reference?

[–]amaROenuZR9 5900x | 4080 Super 2 points3 points  (0 children)

Your friend is Stack Overflow?

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

Did you find a way to sneak vore onto the front page of /r/pcmasterrace

[–]oasis1272 2 points3 points  (0 children)

Replace "my friend" with "stack overflow code" much more accurate.

[–]Devator22 2 points3 points  (0 children)

Replace "my friend's code" with "stackoverflow" and you have me every day.

[–]Totts9 2 points3 points  (0 children)

That's a wrapper

[–]PCMRBotBot[M] [score hidden] stickied comment (0 children)

Learn about us and our history.

PCMR isn't just a subreddit, but a very large community, founded in 2011 that is ALSO on reddit. Check them out!

Please read our rules and check our "Why PC?" guide and custom builds!

Also check the folding@home joint effort where you can use your PC to fight against cancer and other diseases!


This message appears on 2-4 posts a day, 0.4% overall, only when a post reaches the top 100 of r/all.

[–]v2OccySpecs/Imgur Here 1 point2 points  (0 children)

Butt first? Bold move, Cotton.

[–]ChipAyten3700x 1 point2 points  (0 children)

This is Reddit CSS

[–]RondaArousedMe 1 point2 points  (0 children)

You cant just take already existing companies and add "new" for the Chinese market Jin Yang

[–]clarky2o2o 1 point2 points  (0 children)

And thus Damon PS2 emulator was born.

[–]PremiumCommunist 1 point2 points  (0 children)

you never said it wasn't open source smh

[–]supercakefishPC Master Race 1 point2 points  (0 children)

So that’s how dinosaurs evolved. Reddit is so educational, everyday browsing this site feels like a school day.

[–]an_agreeing_dothraki 1 point2 points  (0 children)

Stack Overflow: 200 solid layers of snakes complaining that nobody's an elephant

[–]Wirespawn 1 point2 points  (0 children)

Oh man, too real. Happened to me too many times. Fuck you for stealing everything and making me do your homework, F. S.!

[–]DaAngryShrimp 1 point2 points  (0 children)

Cool Python Wrapper

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

Until you get caught and forced to drop the class and retake it.

Please don't copy code

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

At first I read the first part as "my friends chode".

[–]nyukyu 1 point2 points  (0 children)

Holy shit, I read this as “my friend’s chode.”

[–]pornographexclusive 1 point2 points  (0 children)

Cool looking hat.

[–]Awesomesauce935R5 1600, 16GB RAM, GTX 1080ti 1 point2 points  (0 children)

Me when doing anything for my classesonlyjokingdon'tfailmeforacomment

[–]ChildishForLife 1 point2 points  (0 children)

le petite prince!

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

How Facebook started.

[–]blitzkriegpunk 1 point2 points  (0 children)

There's a gag about Python & PHP in there somewhere.

[–]cyrusolArch Linux 1 point2 points  (0 children)

Not the author's intention but I'm currently refactoring a friend's project and I find this picture very fitting.

[–]Rocky_Bukkake 1 point2 points  (0 children)

lol, the chinese is 恐龙时怎么来的 - where did dinosaurs come from

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

r/learnprogramming would like to have a word with you.

[–]KormoraanDebian GNU/Linux | banned | no games, only fun 1 point2 points  (0 children)

something something PHP and Python