Ask HN: Anyone know any funny programming jokes? 740 points by arthurcolle on Jan 20, 2021 | hide | past | favorite | 852 comments Can be super esoteric or super generalized, I love it when I get them, or when I just learn something new.

 One of my all time favorites. Can’t remember where I first read it (Quora?), but it’s currently my top Google hit for “balloon programmer project manager joke”. [0]============A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts:"Excuse me, can you help me? I promised my friend. I would meet him half an hour ago, but I don't know where I am."The man below says, "Yes, you are in a hot air balloon, hovering approximately 30 feet above this field. You are between 40 and 42 degrees North latitude, and between 58 and 60 degrees West longitude.""You must be a programmer," says the balloonist."I am," replies the man. "How did you know?""Well," says the balloonist, "everything you have told me is technically correct, but I have no idea what to make of your information, and the fact is I am still lost."The man below says, "You must be a project manager""I am," replies the balloonist, "but how did you know?""Well," says the man, "you don't know where you are or where you are going. You have made a promise which you have no idea how to keep, and you expect me to solve your problem. The fact is you are in the exact same position you were in before we met, but now it is somehow my fault."
 A similar joke I heard recently:A helicopter was flying around above Seattle when an electrical malfunction disabled all of the aircraft's electronic navigation and communications equipment.Due to the clouds and haze, the pilot could not determine the helicopter's position and course to fly to the airport.The pilot saw a tall building, flew toward it, circled, drew a handwritten sign, and held it in the helicopter's window. The pilot's sign said "WHERE AM I?" in large letters.People in the tall building quickly responded to the aircraft, drew a large sign and held it in a building window.Their sign read: "YOU ARE IN A HELICOPTER."The pilot smiled, waved, looked at her map, determined the course to steer to SEATAC airport, and landed safely.After they were on the ground, one of the passengers asked the pilot how the "YOU ARE IN A HELICOPTER" sign helped determine their position.The pilot responded "I knew that had to be the Microsoft building because, the response they gave me was technically correct, but completely useless."
 A helicopter was flying around above Seattle...malfunction disabled... aircraft's electronic navigation and communications equipment.......The pilot saw a tall building, flew toward it, circled, drew a handwritten sign, and held it in the helicopter's window. The pilot's sign said "WHERE AM I?" in large letters.People in the tall building quickly responded to the aircraft, drew a large sign and held it in a building window.The Sign was a stylized picture of the helicopter they were in, with a BIG red arrow pointing towards the pilot's window where a small cartoon pilot held up a sign saying 'WHERE AM I" in a hand-rendered Helvetica font.The pilot smiled...yadda yadda yadda..After they were on the ground, one of the passengers asked...The Pilot responded "Tableau Software"
 I have to note that this pilot is always getting into technical problems, and seems to know all the software companies in Seattle and how they are likely to respond - conclusion - the helicopter pilot is a project manager.
 tensility on Jan 21, 2021 This joke must have been written by a journalist who's never been to Microsoft and doesn't bother to fact check their work, since the Microsoft campus is in Redmond and the tallest buildings there are only six stories high.
 jchw on Jan 21, 2021 Well, I can at least tell for sure that I’m on Hacker News, now. :)
 That's technically correct, but ultimately useless, information
 All information is useless until it's useful
 kevincox on Jan 21, 2021 Or they didn't think it mattered if the facts are correct because it is a joke.
 kube-system on Jan 21, 2021 You must be a programmer.
 HeavyStorm on Jan 21, 2021 Thanks, that was annoying me.
 tppiotrowski on Jan 21, 2021 I believe the original form of this joke goes like this:Lost man in a balloon yells down at a man on the ground “Where am I?”The man on the ground responds, “You’re in a balloon”The man in the balloon says “You must be a mathematician”.“Why?” asks the man on the ground.“Because your answer is absolutely right and absolutely useless”
 robbrown451 on Jan 21, 2021 The joke above is a play on the older joke you told.
 ehou on Jan 21, 2021 O the irony of down votes on a meta joke
 That's funny!
 SilasX on Jan 21, 2021 But then that becomes a paradox because the fact that the statement is useless makes it useful.
 Netcob on Jan 21, 2021 Dave's Garage has some good stories!
 That’s where I heard it :)
 I sent this to a project manager once, and they didnt understand nor appreciate it.
 They must be a project manager.
 I, perhaps appropriately, improperly calculated their threshold for humor.
 No, he did't deliver the joke fast enough.
 And neither did he create a jira story for delivering the joke in the sprint!!!
 Project managers wouldn't read the story anyway, they cough up the headline and maybe a few lines of text and expect the team to fill in the blanks during multiple refinement meetings.
 faeyanpiraat on Jan 21, 2021 This is the comment that made me laugh, well done!
 ssss11 on Jan 21, 2021 I’m a project manager and find it hilarious! But i’ve also been technical.
 So you are not "project manager", but "competent project manager", which is something completely different :)
 I’ve never met one of them in the wild. A rare thing indeed.
 They're actually more common than engineers with understanding of project management or the concerns that they quite reasonably have. And they're way more valuable than a zug-zug eng.I say this as a pure engineer who has been a lead many times but never a PM.
 KrishMunot on Jan 21, 2021 I bet a product manager would be more kind
 A man is flying in a hot air balloon and realizes he is lost. He reduces height and spots a man down below. He lowers the balloon further and shouts:"Excuse me, can you help me? I promised my friend. I would meet him half an hour ago, but I don't know where I am.The man below produces a small object the shape of a teardrop colored a pleasing grayish blue that he proceeds to hold above his head in an inverted manner and then with a courtly, elegant bow indicates the ground the bottom of the teardrop is pointing at.The man in the balloon flies off again, exclaiming under his breath "damn designers"
 "And you got there by a bunch of hot air."
 As much as I like the joke and of course understand the analogy, I don't see how, from this conversation, the programmer comes to the conclusion that he has to solve the managers problem. The manager just asked, the programmer gave a technical correct answer and the manager replied that it doesn't help him. But at no point was the programmer expected to solve the managers problem nor has he blamed him so that it's "his fault".
 I think it plays around a common case of a manager saving their ass in front of superiors by shouldering the blame on an unsuspicious employee (“what were you doing all these months, what’s the state of the project, and how are you planning to deliver?”). With time the latter becomes experienced enough to not take the blame, and detects these attempts easily, because it is always happen to be “their” fault.(Sorry if that was obvious and you meant something else.)
 prepend on Jan 21, 2021 PM gave a jerk response denigrating the programmers attempt to help.
 Thats a rehash of an old joke:I know it soviet style:A mathematician, a physicist and a biologist are flying in a air balloon and are lost.They encounter a man walking below:The biologist asks him: "do you know, where we are?""..." the man looks up and says nothingThe physicist ask him: "can you please tell us, where we are!""..." after a while the man says: "in a balloon".The mathematician remarks, ah, he must be a philosopher. The others: "how do you know?""Well, for once he needed a lot of time to answer. Then his answer is correct with our objective reality. And lastly, his answer is completely useless to us."(in eastern soviet republics, philosophy was not in high regards, because the peoples governments were supposed to be philosophical (a la Marx) government, with in theory, very high standards)
 I'm reminded of a joke I heard from a talk by the philosopher Dan Dennett:A philosopher takes his friend to a magic show. After the usual business of vanishing a few small mammals, the magician's assistant lies in a magic box, and the magician, with a dramatic flair, begins to saw through the box.The philosopher's friend leans over and asks What do you think is really going on? The philosopher gives it a moment's thought and replies They're using illusionist skills to give us the impression that he's sawing someone in two, but really he isn't. The philosopher's friend, unsatisfied, asks Right, but how? The philosopher shrugs dismissively, That's really not my department.
 A. Good joke.B. I hate how applicable this joke is to my life. Except I'm the friend asking, then has to figure all the shit out because all the people around me with degrees cant tell the difference between their ass and a hole in the ground.
 lb1lf on Jan 21, 2021 A Soviet engineer needs some plumbing done in his apartment, and calls for a plumber. The plumber arrives, does his thing, and hands over the bill.The engineer is shocked. -'What, this is like a quarter of what I make in a month - for half an hour's work???'Plumber shrugs. -'Well, why don't you come join us? Easy work, well paid, no responsibility - just remember to keep mum about your degree, as we're not supposed to hire academics.'Our engineer contemplates this for a while, applies for a job as a plumber - and gets it.All is well, good money, no responsibilites - until management requires that they take evening school classes to gain new skills and thus better build socialism. So, grudgingly, our engineer enrolls in a math class and, upon arriving, finds that the teacher wants to establish what the plumbers already know.-'You over there - could you please come to the blackboard and show us the formula for the area of a circle?' he asks our engineer.Standing at the blackboard, he suddenly realizes he can't for the life of him remember the formula; while a bit rusty, he soon figures out how to reason it out - furiously writing out integrals on the blackboard, only to find the area of a circle is -(pi)*r^2.Minus? How did a negative enter into it, he thinks, going over his calculations once again. No, still gets the same result. Sweat building, he turns away from the blackboard for a moment, turning to the other plumbers watching.As in one voice, they all whisper -'Comrade, you must switch the limits to the integral!'
 American version from below:The "you learn limits in like, 9th grade" comment reminds me of this one:Two mathematicians are in a bar. The first one says to the second that the average person knows very little about basic mathematics. The second one disagrees, and claims that most people can cope with a reasonable amount of math. The first mathematician goes off to the washroom, and in his absence the second calls over the waitress. He tells her that in a few minutes, after his friend has returned, he will call her over and ask her a question. All she has to do is answer one third x cubed.She repeats "one thir -- dex cue"?He repeats "one third x cubed".She says, "one thir dex cuebd"?Yes, that's right, he says. So she agrees, and goes off mumbling to herself, "one thir dex cuebd...".The first guy returns and the second proposes a bet to prove his point, that most people do know something about basic math. He says he will ask the blonde waitress an integral, and the first laughingly agrees. The second man calls over the waitress and asks "what is the integral of x squared?".The waitress says "one third x cubed" and while walking away, turns back and says over her shoulder "plus a constant!"
 I've heard a variation of that were the professor is at a bar with a couple of visiting professors. He tells them, in this town pretty much everyone is smart and he proves it by asking the waitress. (The rest of the joke is the same.)
 smlckz on Jan 21, 2021 I think the integral is 4 * integrate sqrt(r^2 - x^2) w.r.t. x from x=0 to x=r  which is from the equation of circle with radius r centered at the origin: x^2 + y^2 = r^2 => y = sqrt(r^2 - x^2)  any other way achieve the same using integration?
 You can arrive at the same by slicing in nearly any manner you wish: vertical dx strips, horizontal dy strips, radial dtheta strips, concentric rings treated as rectangles, diagonal strips, literally anything you wish.If you've never set up and worked a few, try the dx version and the dy version, then maybe fiddle with a few others. They all work.The concentric rings one is trivial to work out. Integrate over r from 0 to R. Each ring at radius r has thickness dr, and has length 2 pi r, treated simply as a rectangle, which is "close enough" since each is arbitrarily thin. Then the integral isint_0^R 2 pi r dr = 2pi r^2/2 from 0 to R = pi R^2.A really pretty one cuts the circle into wedges, then rearranges them by alternating direction to make a "rectangle" approx r high, approx pi * r wide, with bumpy top and bottom. In the limit this has area pi * r * r, and can be shown to kids without needing calculus.And it's not magic or circular, since pi is defined (in this case...) as the ratio of circumference to diameter.
 sriku on Jan 21, 2021 \int_0^2π{(1/2)r^2dθ}Value inside the integral is area of thin triangle of height r and base rdθ.
 stevage on Jan 21, 2021 I don't quite get the punchline. I understand how if you integrate in the wrong direction you get a negative area, but is there a double meaning here?
 I believe the implication is that all the plumbers are advanced degree holders, not just the engineer.
 lb1lf on Jan 21, 2021 -The idea is that all the plumbers are academics looking for the easy life. :)
 stavros on Jan 21, 2021 The limits are the shackles of oppression, the integral is the proletariat and switching is disavowing capitalism and seizing the means of production.
 mst on Jan 21, 2021 That was completely unhelpful but also hilarious.As such, a perfect russian joke.
 Thank you, that's what I was going for!
 gmfawcett on Jan 21, 2021 I shall never look at calculus the same way again. :) Thank you, comrade!
 zoom6628 on Jan 21, 2021 Brilliant !
 Too many levels of indirection.
 From the top:
 ayepif on Jan 21, 2021 They're all former academics/mathematicians!
 alphafredo on Jan 21, 2021 They are all engineers in disguise.
 baud147258 on Jan 21, 2021 I think I had already heard that one from a math teacher
 the_gipsy on Jan 21, 2021 Caught me off-guard :D
 benibela on Jan 21, 2021 Could change it like that:A mathematician, a physicist and a biologist are flying in a air balloon and are lost.They encounter a man walking below:The biologist asks him: "do you know, where we are?""..." the man looks up and says nothingThe physicist ask him: "can you please tell us, where we are!""..." after a while the man says: "yes".The mathematician remarks, ah, he must be a logician. The others: "how do you know?""Well, for once he needed a lot of time to answer. Then his answer is logically correct. And lastly, his answer is completely useless to us."
 plasticchris on Jan 21, 2021 I heard this one but it's a mathematician and a physicist in the balloon, and the physicist says the person must be a mathematician. As told by a math professor...
 It sounds like they're in the middle of the Atlantic? Have I got it wrong, I must have because the programmer is supposed to be standing in a field.Wait - are they dead and in heaven!?!
 You must be a programmer. Those who actually checks the requirements.
 Sounds more like a pedantic QA
 ant6n on Jan 21, 2021 Maybe a bug in a joke, perhaps the coordinates need fixing.
 This would never have happened if the joke had been made by one of those 10X Comedians.
 I think without actually getting into the 10x debate regarding engineers, we can all agree that there are definitely 10x comedians.
 Analogous to programming, the average joke-teller just isn’t that funny, making 10x more achievable.“Think of a comedian.” There probably isn’t a 10x that comedian for you.“Find the first person to tell you a joke live next week; considering them as a proxy for average, there is almost surely a 10x comedian out there.”
 dagw on Jan 21, 2021 There probably isn’t a 10x that comedian for you.To me the difference in 'funniness' between a random standup special (even one that is 'good' enough to get a distribution deal) and for example some of Eddie Izzard's best is easily 1000x.But of course my least favorite stand up special is also literally the funniest thing someone else has ever seen. So maybe it washed out in aggregate.
 ralusek on Jan 21, 2021 Kevin Hart, Sarah Silverman, Bert Kreischer - 1xTom Segura, Ali Wong, Nikki Glaser, Bill Burr, Mark Normand, Andrew Santino - 5xDave Chappelle, John Mulaney, Louis CK - 10x
 Which was the first comedian you named in response to the question? Was it Kevin, Sarah, or Bert?My hypothesis is there’s a massive spread in performance in comics, in programmers, and in most fields that are substantially creative and when people argue “there is no 10x ” that it’s more like because their reference frame is higher than mine.
 kcartlidge on Jan 21, 2021 - Milton Jones- James Acaster
 prepend on Jan 21, 2021 The programmer is messing with the PM.
 I think maybe the programmer has forgotten to replace the mock data with a real data feed and he tells everyone who asks the same incorrect latitude and longitude no matter where they are.
 Just for fun I checked where that position would be on world map. Turns out it's in the Atlantic, quite a bit off the east coast of the US.
 I also enjoy a similar one where instead of the programmer stands a statistician and instead of project manager a principal investigator. Source: https://stats.stackexchange.com/a/12745
 Meanwhile, no effort is made on either side to make progress. It is not a joke about software programmer or project manager, it is about self-centered irresponsible people.
 (Not my joke)At a recent real-time Java conference, the participants were given an awkward question to answer: "If you had just boarded an airliner and discovered that your team of programmers had been responsible for the flight control software, how many of you would disembark immediately?" Among the forest of raised hands only one man sat motionless. When asked what he would do, he replied that he would be quite content to stay aboard. With his team's software, he said, the plane was unlikely to even taxi as far as the runway, let alone take off.
 I thought that 'real-time Java' was the joke
 I thought the punchline was going to be about waiting for garbage collection to finish
 If Java had true garbage collection, it would collect itself.
 Java is written in C, so it cannot.
 Truffle went meta and they have java in java now, which gives some nice things.
 I know this joke, but in the version I've heard it's mechanical engineering students instead of programmers, their professors instead of conference participants, and the aircraft itself instead of the flight control software.But the structure is the same.
 I think Radio Yerevan wants you to be chief announcer.
 The Soviet Union's greatest accomplishment was convincing everyone else in the world that Yerevan exists.
 I have been there, I tell you. You gotta believe!
 This is a joke, but this was a literal chat conversation that happened between Boeing engineers in regards for the 737 MAX 8.
 If the plane were my machine there would be no danger.
 It wasn’t until I started working with some of the top software engineers in the industry that I became afraid of flying.
 Reminds me of Arthur C. Clarke's first published short story Travel by Wire!
 This is an oldie (I first heard it in the 80s) but is one of my all time favorites. While it can be told about any two classes of people it really applies to a lot of code I encounter: A physicist is showing a thermos to her friend, a programmer. "It's amazing", she said. "You put a cold drink inside and regardless of how hot it is outside the drink stays cold". The programmer is suitably impressed. "But that's not all", she continued. "You can put a *hot* drink inside and no matter how cold it is outside the drink stays hot". Now the programmer is perplexed. Plaintively he asks, "But how does it know?"  I think of this whenever I read code that contains a gratuitous state variable that explains the type or content of some data structure rather than make the data structure self-explaining. Even more annoying when it's a class.Having to coordinate two variables is a recipe for bugs down the road. Seems like it should be a beginner's mistake but I see it all the time in "non beginner" code.
 I first heard this joke at an AI conference..."An engineer, a physicist, a mathematician, and an AI researcher were asked to name the greatest invention of all time.The engineer chose fire, which gave humanity power over matter. The physicist chose the wheel, which gave humanity the power over space. The mathematician chose the alphabet, which gave humanity power over symbols. The AI researcher chose the thermos bottle."Why a thermos bottle?" the others asked. "Because the thermos keeps hot liquids hot in winter and cold liquids cold in summer.", said the AI researcher. "Yes - so what?" "Think about it.", intoned the researcher reverently. "That little bottle - how does it know?"
 Similar physics mystery: You're a pool of water in the bottom of a bucket, looking out at the stars. Somebody spins the bucket, making the stars spin. So you (the water) arrange your molecules in a parabolic shape, thicker at the sides of the bucket and thin in the middle.How do you (the water know)? How do you know that the stars aren't holes in a paper sheet with light shining through? How do you know the universe isn't spinning, and you're standing still?
 But How Do It Know? Basic Principles of Computers for Everyone
 Thank you, that was where I remembered that sentence from.. Great book!
 Love the joke, but to me it points to something else than gratuitous state variables. I think of it as "if all you have is a hammer, everything looks like a nail", with the hammer being "procedurally solving problems".
 m463 on Jan 21, 2021 Just the same, I wish make were a little more procedural.
 Could you share an example of this? I could be misinterpreting this but say you're building a survey system and you need to keep track of answer types (e.g. text, date, etc) and the answer itself, how can you collapse that into one field?
 Your thermos does not have a switch which you must set to "hot" or "cold" before inserting a liquid, handles solids as well as liquids, and doesn't require you to even think where the theshold might lie between the "hot" and "cold" settings. Instead it just does its best to prevent an energy exchange in either direction without having to even know the variables involved. And the "same subroutine" is basically used for different sized thermoses.In code I see people not understand this all the time. Here's an example: let's say you present the user with their previous orders, and give them the option to filter those orders by some criterion.The shitty way to do this is to have two variables: Filter* orderFilter = NULL; bool filterSpecified = false; void setOrderFilter (filter* newFilter) { orderFilter = newFilter; filterSpecified = true; }  So instead of just checking if a filter has been assigned, you have a separate boolean. What happens if the boolean is true but the filter is null? What would the vice versa case even mean?The global codebase is riddled with dumb errors like this.
 zbuf on Jan 21, 2021 Even better, let's just have the default orderFilter be the equivalent of '*'.If there's always a filter, then there's no longer a branch at the point it's used -- that needs to be tested and maintained.I used to work with a programmer who I found difficult because their code was an ever-increasing number of "if" statements as each new case came along. Conversely he would say coding is relatively easy and that I was overcomplicating a problem by thinking about it; all I needed to do is "add an if statement here".
 nicoburns on Jan 21, 2021 Yep! On of the things I point out most frequently in code reviews are things like this. However, null is an imperfect system for capturing such state. It's not self-documenting, and it breaks down when you have more than 2 states to represent.Languages with Sum Types represent this much more elegantly with arbitrary numbers of variants and force you to check which one you have before accessing the more specific data (e.g. the filter) inside.
 wruza on Jan 21, 2021 I deeply disagree!Our code is riddled with heavily overloaded meanings in a single value/domain, and if you have a variety of filters, you end up with this atrocity: Foo *f1; // hey, just test for NULL double f2; // hey, just use isnan() int f3; // aaaaah, crap bool f3_specified; // god why std::string f4; // requires heavy drugs to solve existential catastrophes  Compare that to template struct Filter { bool is_specified; T value; }; Filter f1; Filter f2; Filter f3; Filter f4;  And the variety of code that has to work with either of these examples.What happens if the boolean is true but the filter is null?An assertion fails miserably.What would the vice versa case even mean?That an assertion failed miserably.What happens if the filter is one? Minus one? Equals to PC(IP), BP? If NULL filter has to search for NULL values in a dataset? If we are looking for NAN values in a corrupted one (this one is even more tricky)?Deeply!
 I'm not sure they were suggesting using type-specific sentinel values (like null and nan), but to always use null or point to a value.I like wrapping the information in a data structure exactly as you suggested, and if you never mutate the dereferenced pointer, it's equivalent to what they proposed. Big if, though.The best is to do this generically with https://en.m.wikipedia.org/wiki/Option_type , since this pattern comes up regularly, not just with this one domain concept of "Filter"
 foota on Jan 21, 2021 Another way of expressing this concept is to "make invalid states unrepresentable"
 User23 on Jan 21, 2021 Dijkstra’s EWDs are full of examples of thinking about problems mathematically instead of operationally and then deriving elegant procedures.
 Do you have any examples to point to?
 Here's one[1].
 yongjik on Jan 21, 2021 100% agree - it's a quite common trap for inexperienced developers to write down every cases and conditions separately, when they shouldn't. As a similar example, instead of writing "req.source = host + port", people would write: if (host == "load-balancer-1.internal.dns") { req.source = HOSTS::LOAD_BALANCER_1; req.source += PORT_MAPPING[HOSTS::LOAD_BALANCER_1]; } else if (host == "load-balancer-2.internal.dns") { // repeat }  After a few quarters of services, layers, and people being added and removed, it becomes a 500-line monstrosity and sits in every critical path. And because now it's a 500-line class (half of which is defunct, but good luck figuring out which half), nobody has time to read through it and figure out that it should have been a single assignment statement.
 elwell on Jan 21, 2021 I think this is one of the areas that functional programming naturally steers the programmer in the right direction.
 Having the two separated gives the ability to disable/re-enable the filter without losing it. That's often very useful. In other cases you're very right.
 Then you'd go with filter_enabled or similar, which is an entirely different, separate flag. It is not coupled to what the filter itself looks like.
 gfody on Jan 21, 2021 this is the essence of Linus Torvald’s doctrine of good taste
 novembermike on Jan 21, 2021 In something like typescript you could represent this as a union type. If I'm expecting a location I could take a string ("Baghdad"), lat long pairs, an enum, etc. With a union type I can specify that it could be any of these but they fill the same purpose. In Java I'd either do method overloading or expect to receive an object that implements a method that would give the location in a common format. The wrong way to do it would be to have a function that has both a lat/long input and a string input and just say that they're nullable and we only expect to get one of them.
 numlocked on Jan 21, 2021 I think they are referring to this sort of thing (the reader will have to use their imagination and assume there is additional functionality in this class): class ReadingMaterial: is_magazine = False def is_periodical(): return is_magazine  Using a base class (e.g. a Magazine and a Book class, or something) and inheritance, is much clearer than monkeying around with state.
 In graphics programming the typical example of this pattern would be when someone does bespoke computations on coordinates with a bunch of if-elses instead of deriving the proper matrix equation that "just works" due to math.
 winrid on Jan 21, 2021 You have an Answer object that probably contains a type enum.However, you don't need to name all variables "answerObject".
 0 if the bottle is empty.1 if its hot.-1 when its cold :D
 Ah yes the triple-boolean
 Reminds me of our five value boolean we used to have: is_deleted. Woe to person who expected that to be 1 or 0. Five distinct and overloaded values were possible, though I now forget them. Probably something like pending, fully deleted, being restored, not deleted, and restored.
 like linux app return codes.
 rzzzt on Jan 21, 2021 A ternary logic computer to go with it: https://en.wikipedia.org/wiki/Setun
 ljm on Jan 21, 2021 FileNotFound if it's none of those
 mrob on Jan 21, 2021 As reported in the famous Daily WTF post:
 A doctor, an architect and a programmer talk about their professions. "Mine is the oldest", says the doctor, "as everybody knows God created Eve from the rib of Adam, and that's definitely a medical operation". "Right", says the architect, "but in fact architect is even older - it's definitely an architectural project to create the world from chaos". At this point programmer kicks back in the chair and gives friends a mysterious look. "Who, do you think, created the chaos?"
 I always heard this with a lawyer at the end.
 The joke's context is Genesis chapters 1-2, so it wouldn't make sense to include a lawyer. Satan only shows up in chapter 3.
 I wish I could give this joke a trophy.
 ezekg on Jan 21, 2021 This made me chuckle :)
 As others mentioned, I've also heard this as a lawyer taking claim from the chaos.I also heard this from a friend that heard it from Ronald Reagan, who claimed it was his favorite joke.
 You win this thread. All high quality jokes.
 All not mine, and definitely old - but we're a big bunch, there are lots of programmers, and not everybody heard them :) .
 A programmer walks into a bar and ask for a drink. The bartender says I'll give you a drink if you tell me a programmer joke. And he says: a programmer walks into a bar and ask for a drink. The bartender says I'll give you a drink if you tell me a programmer joke. And he says: a programmer walks into a bar and ask for a drink. So he gives the guy a drink, so he gives the guy a drink, so he gives the guy a drink.
 ... (continued): The bartender gives him a puzzled look and says, "I didn't get it", to which the programmer responds "To understand recursion you must first understand recursion."
 This is a wonderful easter egg, thanks!
 Did you mean where it says "did you mean . . . "?
 Yes
 abiogenesis on Jan 22, 2021 I think the origins of the joke is the Jargon File: http://www.catb.org/jargon/html/R/recursion.html
 vram22 on Jan 21, 2021 Google gets recursion:
 In a similar vein:One day a student came to Moon and said: “I understand how to make a better garbage collector. We must keep a reference count of the pointers to each cons.”Moon patiently told the student the following story:“One day a student came to Moon and said: ‘I understand how to make a better garbage collector...
 Disclaimer : Details nobody asked for.These are one of the jokes originating from MIT AI Lab. And, Moon mentioned here is David Moon - one of the famous hackers from MIT AI lab.Other such jokes from same origin [1]
 An infinite number of mathematicians walk into a bar. The first one orders a beer. The second one orders half a beer. The third one orders a fourth of a beer. The bartender stops them, pours two beers and says, “You guys should know your limits.”
 There is a bunch of funny problems regarding Hilbert Hotel, with countably infinite number of suits :) .
 Now the programmer just waits till the stack blows up to get his free drink.
 Or whether the tale is optimised
 dvfjsdhgfv on Jan 21, 2021 Well, that depends on the language they speak.
 yoz-y on Jan 21, 2021 That's how you get out of the simulation.
 I thought someone was going to raise a flag.
 This recurs until the programmers runs out of stacks
 Recursive till you fall off your stool.
 Finally, a recursion joke that is not about infinite recursion!
 Well, strictly speaking it is. There is no terminating condition- the OP simply chose to return at an arbitrary point in the recursion.
 Is it? In the outer "real world" the bartender will give the programmer a drink for a joke. It could be a knock-knock joke or anything, but the programmer makes it recursive. Thus making the whole thing a joke to us, otherwise it would be a knock-knock joke embedded in a pointless programmer/bartender reference.In the first joke level, the bartender will give the programmer a drink for a joke; it doesn't work to arbitrarily end here because "a programmer asks the bartender for a drink and the bartender gives him a drink" isn't anything like a joke to qualify at the parent level.The next level is another layer of recursion and here the programmer can literally ask for a drink and get one even though that isn't funny in itself because it can be funny in the context of the outer joke using "he asked for a drink and got one" as a cheeky way to tell a joke to get a drink, and because it's a reference to recursion, the reason for Chekhov's Programmer in the opening sentence, so making something that qualifies as a joke to get the real world programmer a real world beer.Seems to me like it's the earliest point it could return and still potentially work, rather than an arbitrary point?
 I thought it stopped due to exhausting the bar's stock, which conveniently was limited to only three drinks.
 A QA engineer walks into a bar and orders a beer.She orders 2 beers.She orders 0 beers.She orders -1 beers.She orders a lizard.She orders a NULLPTR.She tries to leave without paying.Satisfied, she declares the bar ready for business. The first customer comes in an orders a beer. They finish their drink, and then ask where the bathroom is.The bar explodes.
 This is the first one that made me laugh out loud. My kids came over, “Can I see?” to which I replied “I’m a giant nerd.”
 I just came up with a variation to this off the top of my head.A QA engineer walks into a bar. She orders a beer. She walks out of the bar. She walks into the bar. She walks into the bar. She walks out of the bar. She walks out of the bar. She walks out of the bar. She orders a beer.
 This describes our qa team accurately
 Not a programmer, but this is good.
 If you mean you're not a programmer, rad, good compliment. If you mean QA engineers aren't programmers... wtaf?
 It's weird how some people admit they still test code by hand
 It's very simple: you test things because we can't rely 100% on developers to create the right thing or to create it without any bugs. The same goes for automated test software. I've personally created unit tests that were failing for like 2 years but due to a bug still showed green in CI.To go back to the joke: manual QA is infinitely more likely to find the exploding bathroom than a unit test would ;)Automated testing is a fantastic tool, but manual QA is still very valuable.
 Cthulhu_ on Jan 21, 2021 It's not an either/or though. Used to have an assignment where we as developers would write automated tests (regression tests), while we had an experienced software tester with an excel sheet verifying things by hand. But instead of just following the sheet - which is automatable - he knew of a number of different techniques and approaches and he'd still find a lot of issues that nobody else found. For which we'd write a test to avoid it happening again.I mean I wouldn't have minded if they wrote more automated tests themselves, but I'm also very aware that the mindset of me and developers would quickly become "it's not my responsibility to test my software".
 It's weird how many bugs I regularly find in our software by actually testing things by hand, as opposed to our QA department, which does only automated testing and insists they have covered 100% use-case scenarios.
 rkagerer on Jan 21, 2021 All my tests are individually hand-crafted from sapient pearwood and proctored by a licensed pirate.
 I mean, I’m a programmer and I still test code manually. I’m not sure why it has to be xor
 drdeadringer on Jan 21, 2021 > test code by handPersonally, I find it helpful to bugger out things with pen and paper before coding it out. This is helpful and useful.Greatness to you of you need not the analogue. Others "below you" may and can do just as well. Please do not down your nose upon such folks.
 If “by hand” you mean using your hands to type code that generates tests, then yes, I admit to testing code by hand.
 detaro on Jan 21, 2021 QA is more than running tests by hand you could also just code.
 imtringued on Jan 21, 2021 Automated test suites suffer from the same problem.
 worik on Jan 21, 2021 I do
 There's an old Joel on Software one related to string concatenation:Shlemiel gets a job as a street painter, painting the dotted lines down the middle of the road. On the first day he takes a can of paint out to the road and finishes 300 yards of the road. "That's pretty good!" says his boss, "you're a fast worker!" and pays him a kopeck.The next day Shlemiel only gets 150 yards done. "Well, that's not nearly as good as yesterday, but you're still a fast worker. 150 yards is respectable," and pays him a kopeck.The next day Shlemiel paints 30 yards of the road. "Only 30!" shouts his boss. "That's unacceptable! On the first day you did ten times that much work! What's going on?" "I can't help it," says Shlemiel. "Every day I get farther and farther away from the paint can!"
 Nice plot twist. I thought this one was going to be about optimizing the work that has to be done for one kopeck.
 There's something about strcat there somewhere.
 This could be a metaphor for how a greenfield project turns into a tiresome upkeep effort, after the initial creativity gets further and further buried under the maintenance strain.
 Can be solved by:
 This also applies to pagination based on offset/limit
 The other day I was asking my data scientist brother if you run into this problem training DNN's (anyone: do you?), and ended up telling this one!
 IIUC you generally train on a sliding window of most recent data. That or just keep adding GPUs...
 Every day I get farther from the GPU shop!
 Now this would be funny if it did not bring up painful memories. :-)
 A software engineer, a priest, and a doctor are trying to enjoying a round of golf. Ahead of them is a group playing so slowly and inexpertly that in frustration the three ask the greenkeeper for an explanation. “That’s a group of blind firefighters,” they are told. “They lost their sight saving our clubhouse last year, so we let them play for free.”The priest says, “I will say a prayer for them tonight.”The doctor says, “Let me ask my ophthalmologist colleagues if anything can be done for them.”And the software engineer says, “Why can’t they play at night?”
 I'm a firefighter programmer and I liked this one.
 Well looks like you just leaked Boston Dynamics' next product.
 I thought all programmers are firefighters...
 The way I program, I'm actually an arsonist.
 jidiculous on Jan 22, 2021 The prize for being good at firefighting is being assigned more firefighting.
 stavros on Jan 21, 2021 For a moment there I thought you were the other firefighter programmer I know.
 I think there are about 4 of us on HN that are current or former firefighters (in the literal sense).
 +1 more
 Moru on Jan 21, 2021 Haha, yes, that is so typical us programmers. We always know best and ofcourse there is a simple solution that fixes everything without even having to code a single line. But what if they enjoy the feeling of the sun on the skin while golfing? What if they are not completely blind but can see dark/light shades? This makes it much easier to keep balance.
 I think the joke is that we programmers don't consider such implied requirements.
 …and, at times, lack empathy to a frightening extent ;-)
 ... what if they have to sleep in the same time as everyone else?
 I get hung up by the many reasons why playing at night would be worse for them..
 This is an amalgam of two half-remembered jokes, but I think it works.-------An engineer, physicist, mathematician, and programmer are all hired by a shepherd to create a pen to hold as many sheep as possible with the materials given.The engineer sets to work immediately building a traditional rectangular fence: a proven design which works. She finishes in an hour.The physicist pulls out pencil and notepad, and after a few minutes of computation, determines that a novel circular fence design will enclose the maximum number of (spherical, frictionless) sheep, while remaining structurally sound. He too completes the fence within an hour.The mathematician sits for an hour under a tree in deep thought, suddenly jumps up, wraps herself in a short length of fence, and says, "I declare myself to be outside the fence!" [this is normally where the joke ends]The programmer meanwhile is nowhere to be found, having run off excitedly with his laptop immediately after hearing the problem statement. The shepherd congratulates the other three on a job well done, and they all part ways.A week later, as the shepherd is tending to the flock, he is surprised to see the programmer sitting in the shade of a tree, furiously typing away at his laptop. "Uh, how's it coming?" the shepherd asks.The programmer replies, "It's going great! I've almost finished coding the cross-platform terminal graphics library!"
 This was only the second joke I liked in this thread, reading sequentially. First one was about the balloon.
 It's often said that software engineers have no code of ethics. This is untrue. For example, no respectable software engineer would ever consent to writing a function called DestroyBaghdad().Professional ethics would compel them to instead write a function DestroyCity, to which "Baghdad" could be passed as a parameter.
 > Professional ethics would compel them to instead write a function DestroyCity, to which "Baghdad" could be passed as a parameter.A common rule in the profession would be that that would only be true after they’d coded city-specific destruction functions for two previous cities, otherwise it would be premature abstraction.
 Sometimes you might want to know success though. So...status = destroyCity(&city);This way, because assumingely we may mutate city in some way we’ll still have what comes after to examine, we didn’t pass the name or Od of the city, but the location itself. And we’ll know if overall our destruction worked. It’s also better if you code to MIRSA destruction.
 Because passing the city by copy is way too expensive and won't destroy the original city anyway.
 Ok, here's a variation.A programmer is drafted by the military and ordered to write the software for a city destroying weapon. Given the freedom to choose the implementation language, he chooses Javascript. The user enters the city to be destroyed, which is passed to the Function destroyCity().The General returns from the weapon's fist use in battle furious. "We fired your damn weapon at Bahgdad, and the city's still there! What's going on?""I think I know" says the programmer. Javascript passes it's parameters by value, not by reference."
 ehnto on Jan 21, 2021 Depending on the language the ampersand could mean by copy or by reference. I suspect the commentor wants by reference, since they want to examine it later.
 KMag on Jan 21, 2021 > Depending on the language the ampersand could mean by copy or by referenceYikes. Which languages use ampersand to signal passing by value? That's a massive footgun if I'm ever cargo-culting my way through writing some code in one of those languages for the first time.
 Isn't the real footgun trying to do work you don't adequately understand?
 KMag on Jan 21, 2021 I generally learn a new language by cargo-culting my way through a few small-ish programs. I wouldn't put anything in production in a language that I didn't adequately understand, but I could certainly waste a bunch of time debugging if I got the meaning of & flipped.
 Your right; I meant by reference. I also said MISRA, which implies destruction by means of Sea monster.
 An infinite number of mathematicians walk into a bar.The first mathematician orders a beer.The second orders half a beer."I don't serve half-beers" the bartender replies."Excuse me?" Asks mathematician #2."What kind of bar serves half-beers?" The bartender remarks. "That's ridiculous.""Oh c'mon" says mathematician #1 "do you know how hard it is to collect an infinite number of us? Just play along"."There are very strict laws on how I can serve drinks. I couldn't serve you half a beer even if I wanted to.""But that's not a problem" mathematician #3 chimes in "at the end of the joke you serve us a whole number of beers. You see, when you take the sum of a continuously halving function-""I know how limits work" interjects the bartender."Oh, alright then. I didn't want to assume a bartender would be familiar with such advanced mathematics"."Are you kidding me?" The bartender replies, "you learn limits in like, 9th grade! What kind of mathematician thinks limits are advanced mathematics?""HE'S ON TO US" mathematician #1 screechesSimultaneously, every mathematician opens their mouth and out pours a cloud of multicolored mosquitoes. Each mathematician is bellowing insects of a different shade.The mosquitoes form into a singular, polychromatic swarm. "FOOLS" it booms in unison, "I WILL INFECT EVERY BEING ON THIS PATHETIC PLANET WITH MALARIA"The bartender stands fearless against the technicolor hoard. "But wait" he inturrupts, thinking fast, "if you do that, politicians will use the catastrophe as an excuse to implement free healthcare. Think of how much that will hurt the taxpayers!"The mosquitoes fall silent for a brief moment. "My God, you're right. We didn't think about the economy! Very well, we will not attack this dimension. FOR THE TAXPAYERS!" and with that, they vanish.A nearby barfly stumbles over to the bartender. "How did you know that that would work?""It's simple really" the bartender says. "I saw that the vectors formed a gradient, and therefore must be conservative."
 The "you learn limits in like, 9th grade" comment reminds me of this one:Two mathematicians are in a bar. The first one says to the second that the average person knows very little about basic mathematics. The second one disagrees, and claims that most people can cope with a reasonable amount of math. The first mathematician goes off to the washroom, and in his absence the second calls over the waitress. He tells her that in a few minutes, after his friend has returned, he will call her over and ask her a question. All she has to do is answer one third x cubed.She repeats "one thir -- dex cue"?He repeats "one third x cubed".She says, "one thir dex cuebd"?Yes, that's right, he says. So she agrees, and goes off mumbling to herself, "one thir dex cuebd...".The first guy returns and the second proposes a bet to prove his point, that most people do know something about basic math. He says he will ask the blonde waitress an integral, and the first laughingly agrees. The second man calls over the waitress and asks "what is the integral of x squared?".The waitress says "one third x cubed" and while walking away, turns back and says over her shoulder "plus a constant!"
 I don't get it :( Did she know the answer? Then why the confusion at the start?
 Yeah that does push it a bit, but the joke is that she didn't understand what he was talking about with the 'onethirdxcubed', mis-parsing it without context. But when asked the integral, she knew the answer; not because she'd been told.
 Or in the beginning she’s playing dumb in condescension to the man. The man is trying to prove a point he doesn’t believe. He’s treating her as if she is dumb and doesn’t know the answer, but she does know, and in the end proves she knows it by providing a more complete answer than even the man himself. (You have to assume she knows about the question as the man is telling her the answer.)
 vram22 on Jan 21, 2021 Then it could also almost be a joke about parsing and context-free grammars or such.
 stavros on Jan 21, 2021 Ahh, thank you, that makes sense.
 The version of the joke I'd heard doesn't include the waitress' attempt to meaninglessly memorize the answer. She simply nods when initially tutored, then later surprises both mathematicians that "an average person" knows how to properly solve an integration problem without any help.
 I think that's a better version/telling.
 kazinator on Jan 22, 2021 The waitress is a high functioning autistic. She knows calculus, but cannot work out a mishearing of natural language in a noisy environment, and just memorizes the raw phonemes with meaningless word divisons.
 mkl on Jan 21, 2021 I prefer snappier versions of the first half, like:An infinite number of mathematicians walk into a bar. The first says, "Give me a beer." The second says, "I'll have a half a beer." The third says, "A quarter of a beer, please." The bartender pours two beers and says, "Come on, people. Know your limits."Copy-pasted from https://owlcation.com/stem/Worst-Math-Jokes-and-Math-Puns, but there are many similar versions.
 Yes. The version before was like going nowhere.
 An infinite number of mathematicians walk into a bar, where a beer costs 3$.The first mathematician orders a beer.The second mathematician orders two beers.The third mathematician orders three beers."Oh, I see where this is going" says the bartender and pays a quarter to the first mathematician. "This should cover your check, then."  Is this an antijoke or did I just need to know where it's going, like the bartender? Maybe the bartender is confused?  The joke is that the Ramanujan sum of 1 + 2 + 3 + 4 + ... is equal to -1/12, so the check should be$3 * -1/12 = minus one quarter. [0]
 Thanks, that's a bit of math trivia I either forgot or never learned.
 evanb on Jan 21, 2021 This joke relies on the listener knowing that the regularized sum of 1+2+3+... = -1/12.
 That's what makes it funny!
 paraknight on Jan 21, 2021 Can you explain?
 1 + 2 + 3 + ... = -1/12 total beers-1/12 beers * $3 / beer = -$0.25negative -> pay them for taking the beerThe -1/12 result is pretty widely known, but not particularly true. It's called "analytic continuation." There's a nonrigorous proof that's accessible at a highschool level - see [here](https://en.wikipedia.org/wiki/1_%2B_2_%2B_3_%2B_4_%2B_%E2%8B...)Delightfully, this comes up in string theory, in computing the dimensionality of spacetime.
 9000 on Jan 21, 2021 It's referencing a theorem from string theory, as discussed in this Numberphile video: https://www.youtube.com/watch?v=w-I6XTVZXwwThe catch is that this isn't valid in what we consider standard mathematics, and you can find many discussions of this online, but this one is fairly short and straightforward: http://curiouscheetah.com/BlogMath/infinity-and-string-theor...
 duffmancd on Jan 21, 2021 The sum of all positive integers can be somewhat described as negative one twelfth: https://www.youtube.com/watch?v=E-d9mgo8FGk
 I want to hear Norm Macdonald tell this joke.
 froh on Jan 21, 2021 So the programmers joke here is the silent nod to jamie zawinski, as a maths savvy guy who is bartending?
 mkl on Jan 21, 2021 Don't click this link, copy and paste it. JWZ redirects clicks from HN.
 How exactly does a redirect like that work? I didn't know links provided context when loading the subsequent page.
 The web server was configured to check the referrer. If (referrer === ‘https://news.ycombinator.com’) { // show offensive pic of male genitalia }
 abiogenesis on Jan 22, 2021
 kroltan on Jan 21, 2021 Or click it too! It's pretty hilarious
 > and with that, they vanish.I feel like that was the most hilarious part, and the joke could have ended there as like an anti-joke of sorts. I like how crazy it got with the "FOOLS" part. Unexpected...
 90% through I reached for the flag button, 2 seconds later, I'm weeping. Thank you
 I feel like this is every corny maths joke all rolled into one. Very creative.
 this has levels.
 Ohoooo, that was a nice one !
 Hey, it's not cool to steal jokes from /r/antiantijokes. I am a mod there (as evident from my username), and don't appreciate this. The joke is hilarious though.
 > Hey, it's not cool to steal jokes from /r/antiantijokes.When is it okay to repeat a joke from the internet and when is it not?
 edoceo on Jan 21, 2021 Always and Never, at the same time.
 0-_-0 on Jan 21, 2021 Joke piracy is rampant these days...
 raphyjake on Jan 21, 2021 I had no idea where this was from. Sadly the guy who sent it to me didn't tell me the joke was under copyright
 You never googled the joke to see where it was from?
 Who the heck does that, and why???
 raphyjake on Jan 25, 2021 do you google jokes..?
 some_random on Jan 21, 2021 so many poor poor redditors are going to have trouble feeding their children because of this tragic joke piracy ;(
 whatbutwhy on Jan 22, 2021 I'm surprised you think no one on r/antiantijokes stole that joke to put it there
 kchr on Jan 21, 2021 Are you saying you've never told a joke without knowing (or mentioning) the source...?