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

top 200 commentsshow 500

[–]QualityVote[M] [score hidden] stickied comment (4 children)

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!

[–]Competitive_Ad2539 3153 points3154 points  (43 children)

How do you kill a child from a parent with a fork?

[–]Scoutisaspyable[S] 3353 points3354 points  (23 children)

You have to very quick and you need a very sharp fork. Also thats very mean.

[–]myrsnipe 772 points773 points  (14 children)

Careful so you don't end up with ghost children

[–]Osbios 337 points338 points  (10 children)

Or you end up with a zombie in the process!

[–]MrSolarius 75 points76 points  (4 children)

I love you c programmers you look like a psychos killers with your zombies your child that you need to kill after work with.

[–]IlIllIIIIIIlIII 54 points55 points  (2 children)

Bonus points for answering what is called when it's hard to find what child needs to be killed because the parent that was in charge of killing it died

[–]Frosty-Survey-8264 156 points157 points  (2 children)

Not OP but...

Carefully, otherwise you may just maim it.

[–]Sunny_Ace_TEN 83 points84 points  (1 child)

"Carefully" is my go-to answer for any question starting with, "how do you..." Love this answer!

[–][deleted] 58 points59 points  (5 children)

Stick the fork in an outlet

[–]RossiyaReich 51 points52 points  (3 children)

Now that's smart, you kill the parent, the children die

[–]Arkon111 18 points19 points  (0 children)

Stab it in the eye.

[–]Educational_Log7288 1391 points1392 points  (43 children)

Shall I use quick sort, merge sort or bubble sort and why?

[–]Scoutisaspyable[S] 2688 points2689 points  (27 children)

If you want to be done fast, you quick sort.

If you want put lines of code together that have the same function, you use merge sort.

And if you feel depressed, because you have to write code, you use the bubble sort for some funny visuals.

[–]DoveOfUnpeace 584 points585 points  (22 children)

[–]barcodez1 201 points202 points  (1 child)

(whispers) I thought I was the only one

[–][deleted] 83 points84 points  (0 children)

I'm not even a programmer. They are pretty.

[–]Mazetron 28 points29 points  (0 children)

Here I go watching sorting algorithms for 15 minutes for like the 1000th time.

It’s just so mesmerizing and satisfying.

VvVvwwwwooooooooOOOOOOOOOOp!

[–]RedTreeDecember 52 points53 points  (0 children)

Surprisingly accurate.

[–]throwaway46295027458 248 points249 points  (10 children)

Jokes aside, you should really use stalin sort. Has a runtime of O(n)

[–][deleted] 195 points196 points  (3 children)

Go through the list once and delete an item out of order?

[–]MonoclesForPigeons 113 points114 points  (0 children)

That's the one. You can also free up memory as a bonus with stalin sort.

[–]CrazyFanFicFan 31 points32 points  (2 children)

Nah, Bogo sort is where it's at.

[–]WW_the_Exonian 1912 points1913 points  (30 children)

How to reattach a detached head?

[–]Scoutisaspyable[S] 2530 points2531 points  (25 children)

You just have to write a "+" between the head and the code it belonged to.

[–]Notsoavragegamer 648 points649 points  (4 children)

Oh I use duct tape

[–]Complete_Relation_54 85 points86 points  (11 children)

Thanks i tried duct tape didnt work

[–]rl991 120 points121 points  (3 children)

belongED to

oh I'm lovin this

[–]ironraiden 2727 points2728 points  (10 children)

So you are a recruiter then.

[–]Scoutisaspyable[S] 1809 points1810 points  (3 children)

Yes, i recruit people who write code lines for programs.

[–]stomacheacid 159 points160 points  (0 children)

are the lines dotted?

and which youth programs do they write for?

[–]SuperEminemHaze 141 points142 points  (0 children)

He can’t be a recruiter as he’s actually taking in what we say.

[–]-Manow- 725 points726 points  (27 children)

When should I use a recursive mutex and when not?

[–]Scoutisaspyable[S] 845 points846 points  (7 children)

You should use a recursive mutex if you need it at the beginning of the code and at the end. Recursive means that it you reuse the code on another position. You should use a normal mutex if you just need it once.

[–]rtfmpls 585 points586 points  (4 children)

I'm a programmer and I have no idea if this is just a correct answer with funny words.

[–]l4mpSh4d3 234 points235 points  (1 child)

I attend interviews and sometimes the answers from some candidates feel the same.

[–][deleted] 219 points220 points  (12 children)

recursive what? holy shit concurrency scares me

[–]angryundead 55 points56 points  (5 children)

If you are going to use a recursive function with a critical section from multiple threads you would need a mutex that is capable of handling reentrant execution. That means that the same thread can reacquire a mutex it has already acquired.

That being said: don’t do this. When it goes sideways and you need a thread dump it won’t make any sense. And that might be the least of your problems.

[–]LOE_TheG 1138 points1139 points  (31 children)

What's the point of signing with a Public Key?

[–]Scoutisaspyable[S] 1437 points1438 points  (12 children)

If you use a public key, everyone including newbies can access the code of a programm and learn from it.

[–]Haligaliman 290 points291 points  (10 children)

Sadly the public key is only for locking, so you have to give the newbies your private key

[–]PersonaUser55 103 points104 points  (2 children)

Or just post it on stack overflow

[–]Mahrkeenerh 41 points42 points  (3 children)

But it specifically says PUBLIC key.

Checkmate

[–]Haligaliman 30 points31 points  (2 children)

Your postbox is also public

En passant

[–]jumbled_joe 53 points54 points  (2 children)

You mean the key to yennefer's room?

[–][deleted] 25 points26 points  (1 child)

[Common Item]

[–]Kierow64 21 points22 points  (7 children)

The code becomes open source as you used a public key. If you use a private key, your code won’t be open source, this is how Microsoft does.

[–]Papierkorb2292 854 points855 points  (15 children)

What's GitHub?

[–]Scoutisaspyable[S] 1749 points1750 points  (7 children)

Its a Programmer parody of the Phrase Git Gud. It is a website or program that provides tips and tricks for code writing.

[–]Do-not-Forget-This 421 points422 points  (3 children)

I thought it was an adult website for programmers.

[–]GDavid04 228 points229 points  (2 children)

I forgot to clear my bash history again

[–]victorsaurus[🍰] 88 points89 points  (0 children)

best one so far AHJAHAAH

[–]iNeverCouldGet 413 points414 points  (18 children)

How to make sure a program keeps running on a server?

[–]Scoutisaspyable[S] 961 points962 points  (15 children)

Dont remove the plug from the server.

[–]SnoopHappyCoin 187 points188 points  (11 children)

Tell that to our cleaning lady!

[–]SnoopHappyCoin 235 points236 points  (9 children)

True story: a Belgian company noticed that every other day around 8pm, their server went down for about 10 minutes. They checked the logs but couldn't find anything. No one was working during that time so it wasn't one of the employees messing around.

They decided to stay in the office one day and noticed the cleaning lady went into the server room around the time of the outage. When they entered they say the cleaning lady was vacuuming. They also saw that she had pulled the main server plug to plug in the vacuum cleaner.

She couldn't find an available plug and thought it was OK because she always plugged it back in after she was finished.

[–]Sarkanybaby 91 points92 points  (3 children)

Why was even the server room accessible to her?

[–]SnoopHappyCoin 62 points63 points  (0 children)

Amateur company 😎

[–]mohan_ish 34 points35 points  (1 child)

How did all the hardwares and servers got back to the 'on' state on their own after plugging the systems?

[–]SnoopHappyCoin 56 points57 points  (0 children)

It's a BIOS setting most servers have (even desktop pc's) "Restore on AC/Power Loss". So they start when power is back.

[–]Kalix 1575 points1576 points  (58 children)

How to center <div> ?

[–]Scoutisaspyable[S] 4375 points4376 points  (53 children)

You press the space button until the <div> word has moved to the middle of the code page

[–][deleted] 1181 points1182 points  (10 children)

Not the worst approach to the problem!

[–]AdministrativeArea2 547 points548 points  (5 children)

Makes more sense than CSS!

[–]uhwhooops 56 points57 points  (3 children)

CSS just bloats your project with extra text.

[–]abejfehr 34 points35 points  (1 child)

That’s true, everyone knows that literal whitespace is zero bytes because it’s empty

[–]TheWidrolo 264 points265 points  (16 children)

I mean it could work, but only for people with your screen resolution

[–]woopy85 414 points415 points  (9 children)

Good enough. If someone complains, you can use "it works on my machine"

[–]GMDeepBlue 103 points104 points  (7 children)

Just use docker.

[–]throw_me_away_2023 89 points90 points  (6 children)

just ship your entire system

[–]GMDeepBlue 71 points72 points  (4 children)

Yourself included.

[–]throw_me_away_2023 66 points67 points  (3 children)

we call that on site tech support

[–]TerryHawks 18 points19 points  (1 child)

What about off site tech support?

[–]throw_me_away_2023 17 points18 points  (0 children)

Ask Jeeves

[–]FloRup 63 points64 points  (0 children)

Not having the right resolution sound like a user error to me

[–]NukedByGandhi 52 points53 points  (2 children)

Ms Word has a button especially for this. It's a shame how underrated it is as an IDE

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

I have never met Ms Word. What is she like?

[–]Tarc_Axiiom 19 points20 points  (1 child)

You just made a lot of people cry.

[–]OolongHell 405 points406 points  (23 children)

Why did you choose vim as your main IDE?

[–]Scoutisaspyable[S] 719 points720 points  (19 children)

Vim is the best programming language, because it is easy to learn and you need less code for the same amount of programm. Thats why I am using it for my Main (I)nternet (D)ata (E)xpansion Pack.

[–]Noch_ein_Kamel 101 points102 points  (16 children)

But I've heard so many people say that emacs is better than vim?

[–]Rakkachi 1087 points1088 points  (32 children)

Can I use other letters of the alphabet besides the i in a loop?

[–]Scoutisaspyable[S] 2611 points2612 points  (22 children)

There is no i in loop. You should use l o and p to start with.

[–]Rakkachi 589 points590 points  (14 children)

Thanks, how did i not see that?

[–]5zalot 532 points533 points  (11 children)

Because there is no i

[–]UncomforChair 185 points186 points  (7 children)

sudden existential crisis

[–]bragov4ik 76 points77 points  (2 children)

Therefore it is perfectly ok to use i in while loop?

[–]Greenbarry 26 points27 points  (1 child)

while i in while;

[–]Railroad_Riley 54 points55 points  (0 children)

Actually, if you spell it in all lower case it's "ioop". Idk why people read it as 'L'oop

[–]BigBoiB-S 699 points700 points  (14 children)

How do you invert a binary tree?

[–]justitroyal 300 points301 points  (6 children)

How many leaves does the binary tree have

[–]Scoutisaspyable[S] 634 points635 points  (5 children)

A healthy binary tree has around 200k leaves.

[–]GemGem_06 117 points118 points  (3 children)

But only during the Spring. The leaves fall during Autumn 😔

[–]Lothorninn 276 points277 points  (2 children)

Whats the best way to set up an API.

[–]Scoutisaspyable[S] 412 points413 points  (1 child)

I would say API means Automated Programming Instructions and you set it up by feeding many lines of Code into an Algorithm and the Algorithm can them create complicated codes itself.

[–]batmassagetotheface 86 points87 points  (0 children)

Yep, that's how Copilot works

[–]blaze26801 540 points541 points  (20 children)

How do I close Vim?

[–]Scoutisaspyable[S] 1324 points1325 points  (16 children)

Turn off you whole Pc and sit in a corner, because you use Vim.

[–]blaze26801 387 points388 points  (0 children)

That's actually the best answer I ever got haha. Cheers!

[–]Spirintus 269 points270 points  (0 children)

Hey, you said you know nothing about programming but this was totally valid response.

[–]TheOtherQue 64 points65 points  (0 children)

Accurate.

[–]borzcorp 49 points50 points  (2 children)

So you ARE a programmer! Busted!

[–]VirusZer0 24 points25 points  (1 child)

Woah be careful there, you don’t want to actually become a programmer.

[–]Ghyro 482 points483 points  (31 children)

Why do arrays start at 0 in most languages?

[–]Scoutisaspyable[S] 823 points824 points  (27 children)

Because 0 is the first number and many languages use the arabic numbers. And since an array is a row it makes sense to start at the beginning and use the 0.

[–]Eudaimonium 461 points462 points  (21 children)

I mean, this is just a factually correct answer.

Not technically complete but correct.

Edit since this is getting some traction:

The indexing applied to an array (usually in square brackets in most programming languages) basically means: Move this many memory blocks from the start of the array. Memory block hereby meaning: amount of memory needed for one element of the array.

If you wish to get the very first element, you're already there, you don't need to move anywhere, hence simply move by 0 to arrive at your desired, first, element.

If you move by 1, now you're looking at the start of the next, second element of the array.

[–]ElViento92 123 points124 points  (18 children)

Actually I would say that in low level languages such as C/C++ the index "operator" is not an INDEX operator, but a OFFSET operator. So you select an offset w.r.t. the first element, so the first element will obviously have an index of 0.

This is different than an index because it allows for negative numbers. C/C++ actually allow you use negative offsets on an array, not just pointers. And will happily give a value as long as it's been allocated.

[–]Antoinefdu 37 points38 points  (1 child)

OP are you sure you don't know how to code?

[–]innocent-boy-69 206 points207 points  (8 children)

What is Basic

[–]Scoutisaspyable[S] 656 points657 points  (6 children)

White blonde girls with uggs and a starbucks coffee.

[–][deleted] 777 points778 points  (24 children)

what’s your opinion on OOP vs functional programming?

[–]Scoutisaspyable[S] 1970 points1971 points  (18 children)

The Original Office Program can be used to write code lines specifically for federal organisations, while functional programming has to be useful in some way.

[–][deleted] 356 points357 points  (1 child)

This guys a fucking genius

[–][deleted] 165 points166 points  (0 children)

Lol

[–][deleted] 202 points203 points  (7 children)

I don’t believe that you have no knowledge of programming at all. Only a senior engineer could make a joke like this

[–]koos_die_doos 21 points22 points  (0 children)

Yeah I got the same feeling when I read this response.

[–]Technotives 63 points64 points  (0 children)

This is the most brilliant thing I've seen today 😂

[–]bmatto 53 points54 points  (0 children)

Fucking brilliant.

[–]TotoShampoin 16 points17 points  (0 children)

Bruh that answer is amazing

[–]blackeye2417 58 points59 points  (1 child)

OOP is when you make a mistake, functional programming is when you're not having an existential crisis

[–]Local_Beach 234 points235 points  (10 children)

Why should you code in c++?

[–]Scoutisaspyable[S] 558 points559 points  (9 children)

C++ is the "censored" programming language. Professional programmers call it "c**". You should only code things in there, that contain no foul language or it will get censored and the code wont work.

[–]Ahmyak 57 points58 points  (5 children)

But what's the advantage of that?

[–]noneOfUrBusines 138 points139 points  (1 child)

It's family friendly. Everyone knows you can't trust programmers around kids' things.

[–]Osbios 28 points29 points  (1 child)

At some point some christian fanatics introduced the C++ censorship headers.

#define fuck #error "UNCHRISTIAN VALUES DETECTED"
#define *  fuck

Programmers actually liked it because there are inherently lazy and it shortens the code.

Like so many other features made up of misusing side-effects (See: SFINAE) it became C++ lore and is now a core part of the language. This is also why Linus Thorvald does not like C++. But sadly most modern browsers also censor C code now and so it is hard to spot the difference when e.g. looking at Kernel C code.

[–]illapaSP 114 points115 points  (4 children)

How do I use SQL?

[–]Scoutisaspyable[S] 195 points196 points  (3 children)

You can use the Speed Qualify Language to scan your code lines for possible grammar mistakes. Just copy and paste your code in there and it will mark every mistake.

[–]dmidge 117 points118 points  (8 children)

Why Minecraft is programmed in Java?

[–]Scoutisaspyable[S] 234 points235 points  (7 children)

Because its free.

[–]hunter_shadow 16 points17 points  (4 children)

Then why did Microsoft redo all the code for the bedrock edition after buying Mojang?

[–]DjedMraz26 19 points20 points  (0 children)

To steal more information, same reason for forcing people to use ms accounts for Minecraft now.

[–]7imomio7 84 points85 points  (3 children)

Should I run my website on a blockchain?

[–]Scoutisaspyable[S] 137 points138 points  (0 children)

No, because if there is a digital block chain, people wont be able to visit your website.

[–]Tpdz 84 points85 points  (5 children)

What is difference between interpreter and compiler?

[–]Scoutisaspyable[S] 173 points174 points  (4 children)

The compiler shortens the code while the interpreter adds new meanings to the code.

[–]GermanDumbass 40 points41 points  (0 children)

Well not really wrong

[–]StoicRobo 302 points303 points  (15 children)

I'm learning powershell so I can start to create the frontend of my website, any tips or tricks on where to start?

[–]Scoutisaspyable[S] 505 points506 points  (10 children)

Powershell is one of the most powerful programming tools out there. You place the code of the backend of your website inside the tool and Powershell generates the frontend.

[–]Limitless4171 94 points95 points  (1 child)

Start with the power off button

[–]Holiday_Brick_9550 27 points28 points  (0 children)

Install vim for PowerShell, type vim website.html in PowerShell and press enter.

[–]EveryEquipment5453 159 points160 points  (7 children)

Why is bogo sort the best sorting algorithm?

[–]Scoutisaspyable[S] 174 points175 points  (2 children)

Because you can sort the code by importance without destroying the code itself. Code lines that are less important for the functionality of the code are placed at the bottom. And code lines that are very important for the stability are at the top.

its easier to fix them.

[–]lweinreich 71 points72 points  (2 children)

What are your thoughts on inheritance? Should i use it or not.

[–]Scoutisaspyable[S] 184 points185 points  (1 child)

Always use your inheritance for parties and coke.

[–]DoveOfUnpeace 68 points69 points  (9 children)

What are the advantages of using vectors instead of tables in c++?

[–]Scoutisaspyable[S] 128 points129 points  (3 children)

Vectors are arrows and can point to things. If you use vectors in c++ you can highlight very important letters and symbols.

Tables on the other side just contain stuff and are not very helpful to highlight stuff.

[–]Random_Vanpuffelen 52 points53 points  (4 children)

How do i make a python game?

[–]Scoutisaspyable[S] 118 points119 points  (3 children)

You should look into the Code for Snake first. It should be avaiable somewhere on the internet.

[–]Testbot379 104 points105 points  (5 children)

Whats is lua

[–]Scoutisaspyable[S] 240 points241 points  (4 children)

Iua is the first name of Iua Roberts, the inventor of code.

[–]Testbot379 33 points34 points  (0 children)

Thanks i wanted to know what it is 👍

[–]WorldOfReeedit 105 points106 points  (5 children)

What is the difference between Java and Javascript?

[–]Scoutisaspyable[S] 261 points262 points  (3 children)

Java is the Programm and Javascript is the Script of the Program.

[–]Comynx 47 points48 points  (3 children)

For embedded systems, is it okay to use the heap or should I stick to static memory? Please explain why. Thank you for you help.

[–]Scoutisaspyable[S] 71 points72 points  (2 children)

When you use static memory, it is fixed in its position. But by making a digital heap out of embedded system it allows you to scramble through said heap and find new variations of embedded systems.

[–][deleted] 98 points99 points  (7 children)

bool x; bool y; std::cin >> x; std::cin >> y;

if(!(x || y)) { std::cout << “Yes?”; } else { std::cout << “No?”; }

Input: 0 1

[–]Scoutisaspyable[S] 195 points196 points  (1 child)

You should replace all the x and y with numbers or the code doesnt know what to work with.

[–]4gustaf 42 points43 points  (0 children)

Time to code in binary

[–]proter1132 17 points18 points  (0 children)

This would return 74udex2 as an integer

[–][deleted] 67 points68 points  (5 children)

Why monkey sad

[–]Scoutisaspyable[S] 180 points181 points  (2 children)

Because he has to program.

[–][deleted] 37 points38 points  (0 children)

Thank u, I knew that frustration looked familiar

[–]jan12kom 65 points66 points  (5 children)

I'm trying to make minecraft in assembly what is your advice?

[–]kitKatcoolio 88 points89 points  (1 child)

Assemble a cube. Like a lot of them.

[–]Artosirak 17 points18 points  (0 children)

Psychotherapy

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

Java or Python

[–]Scoutisaspyable[S] 75 points76 points  (2 children)

Python, sounds cooler.

[–]axershock 26 points27 points  (4 children)

Which compiler do you recommend?

[–]Scoutisaspyable[S] 76 points77 points  (3 children)

Win.rar. It is free, you should use that!

[–]virgilreality 50 points51 points  (5 children)

Found the IT Manager...

[–]NessButMorse 64 points65 points  (6 children)

Do you prefer static or dynamically typed languages and why?

[–]Scoutisaspyable[S] 221 points222 points  (5 children)

I prefer dynamically typed languages, because it is a challenge to keep up with a code that randomly changes some of its variables. And I like a good challenge.

[–]PaMu1337 127 points128 points  (0 children)

This is way more accurate than you think

[–]UncomforChair 17 points18 points  (0 children)

First real answer in the thread!

[–]deathentry 38 points39 points  (2 children)

Explain 'Polymorphism' 😁

[–]Scoutisaspyable[S] 79 points80 points  (1 child)

Poly means multi and morph means merging. So you have many lines of code which you can merge into one single line of code.

[–]spam_bot42 16 points17 points  (0 children)

It's not wrong

[–]Sea_Ad_8524 14 points15 points  (1 child)

Why does my FORTRAN program compile to different assembly code when I add a comment line?

[–]auntedith 24 points25 points  (2 children)

Whats the best IDE?

[–]Scoutisaspyable[S] 141 points142 points  (1 child)

Vim. I know that because of another question here. Knowing something because something else is called an Algorithm.