Live data from Hacker News

Ask HN: Anyone know any funny programming jokes?

news.ycombinator.com

351–360 of 905 posts

Re: Ask HN: Anyone know any funny programming jokes?

#351
It’s bigger than a joke but pretty funny: http://www.stilldrinking.org/programming-sucks

Money quote: “Also, the bridge was designed as a suspension bridge, but nobody actually knew how to build a suspension bridge, so they got halfway through it and then just added extra support columns to keep the thing standing, but they left the suspension cables because they’re still sort of holding up parts of the bridge[…] Would you drive across this bridge? No. If it somehow got built, everybody involved would be executed.”

Re: Ask HN: Anyone know any funny programming jokes?

#352
post #344

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 v…

So the programmers joke here is the silent nod to jamie zawinski, as a maths savvy guy who is bartending? https://www.jwz.org/about.html

Don't click this link, copy and paste it. JWZ redirects clicks from HN.

Re: Ask HN: Anyone know any funny programming jokes?

#353
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!"

Re: Ask HN: Anyone know any funny programming jokes?

#355
post #193

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 a…

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.

Re: Ask HN: Anyone know any funny programming jokes?

#358
post #94

(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 c…

If the plane were my machine there would be no danger.

Re: Ask HN: Anyone know any funny programming jokes?

#359
post #156

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.

Now the programmer just waits till the stack blows up to get his free drink.

Re: Ask HN: Anyone know any funny programming jokes?

#360
Back when Chuck Norris facts were popular there were Jeff Dean facts, and this one is my favorite:

Jeff Dean puts his pants on one leg at a time. But if he had more than two legs, you would see that his approach is actually O(log(n)).

Oh, and do unintentional jokes count? Because AbstractSingletonProxyFactoryBean is pretty funny. https://docs.spring.io/spring-framework/docs/3.0.6.RELEASE_t...

Post reply on HN