Live data from Hacker News

Ask HN: Anyone know any funny programming jokes?

news.ycombinator.com

691–700 of 905 posts

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

#691
post #352

Earlier quoted context omitted.

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 
   }

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

#692

A programmer, an engineer, and a physicist are in adjacent hotel rooms. Each has a pitcher of water beside the bed. A fire starts in the wastepaper basket in each room. The physicist wakes up, sees the fire, estimates exactly how much water is needed to put it out, and pours exactly that amount from the pitcher, dousing the flames. The engineer wakes up, sees the fire, pours the entire pitcher of water on it, then re…

Variant I heard, had a physicist, engineer, and mathematician sharing a room.

The first two wastepaper basket fires were taken care of the same ways by the physicist and engineer.

Then a third fire appears, but on the curtains. The mathematician says he'll take care of it, so the others go back to sleep. The mathematician removes the curtains, puts them in the wastepaper basket, and says, "Now it's a solved problem." He then goes back to sleep.

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

#693

Earlier quoted context omitted.

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

Automated test suites suffer from the same problem.

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

#694
post #82

The 2 problems you can never completely eliminate in your code are the need for tests, suboptimal names, and off by one errors.

The way I heard this (https://twitter.com/codinghorror/status/506010907021828096?l...) was "There are two hard problems in computer science: cache invalidation, naming things, and off by one errors."

Still good though.

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

#696
post #355

Earlier quoted context omitted.

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

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!

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

#697
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…

It wasn’t until I started working with some of the top software engineers in the industry that I became afraid of flying.

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

#698

Earlier quoted context omitted.

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 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.

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

#700
post #285

Earlier quoted context omitted.

I once worked on making a progress bar for a process that had a known number of tasks. Unfortunately not all tasks would take the same amount of time, and it was impossible to know the relative amount of time each task would take beforehand. I did the logical thing, and had the progress bar advance 1/nth every time a task completed, with an animation to make it less jarring. A few weeks later, the product manager cam…

I made zeno's progress bar; it always keeps moving, but never quite finishes until you send it a :done: event, at which point it wastes half a second animating the remainder of the progress bar. Never had a single complaint, and no one noticed that it had nothing to do with what was going on under the hood.

Like the current Windows file copy dialog, but using the entire bar instead of the interval between 98% and 100%?
Post reply on HN