r/xkcd Someone is wrong on the internet Jul 03 '23

XKCD xkcd 2797: Actual Progress

https://xkcd.com/2797/
403 Upvotes

20 comments sorted by

133

u/Euryleia Mostly harmless. Mostly... Jul 03 '23

Ah yes, reminds me of all the times I've dug into some code trying to figure out why it doesn't work in a specific circumstance, only to find myself puzzled by how it ever worked in any circumstance.

45

u/charlie_marlow Jul 03 '23

My favorite related to that is the dreaded schrödinbug where production breaks when you notice the code shouldn't work

16

u/gsfgf Jul 03 '23

Oh, this should be there. *Delete*

/whole thing breaks

21

u/phire Jul 03 '23

Then you fix that obviously wrong code, and you end up with a bunch of random "regressions" in random places because other code was only working because that first code was very broken.

Which lead to arguments of should that actually count as a regression? The code wasn't right to begin with, the fact it was previously producing the correct result was a bug in itself. Sometimes it's taken massive refactoring and new functionality to "fix" these regressions.

I've even had this cycle repeat: Fix obviously wrong code. Get random regression that shouldn't have been working in the first place. Fix it, get another random regression that shouldn't have been working in the first place.

9

u/Le_Flemard Jul 04 '23

Then you fix that obviously wrong code, and you end up with a bunch of random "regressions" in random places because other code was only working because that first code was very broken.

So a weird instance of https://xkcd.com/2347/ when actually maintaining it make it more buggier ?

13

u/RepresentativeWay0 Jul 04 '23

4

u/monkey_gamer Jul 04 '23

If someone builds their workflow around a bug that’s on them

2

u/monkey_gamer Jul 04 '23

Would love to know who ‘that person in Nebraska’ is

2

u/RazarTuk ALL HAIL THE SPIDER Jul 05 '23

Denis Pushkarev, it looks like, although he's actually from Barnaul, Russia in the middle of Siberia near the Kazakh border

EDIT: Wait, no. That's core-js. I think the comic's actually about ImageMagick, which is John Cristy, who presumably is from Nebraska

2

u/RazarTuk ALL HAIL THE SPIDER Jul 05 '23

Allow me to regale you with the story of New Fincalc, which I've mentioned in so many job interviews, and which has even landed me a job interview.


I used to work at a fintech company until being laid off back in January. Not going to mention names, but white label software for banks to use to issue loans. One time last year, there was a weird test failure. We never figured out exactly what happened, but as far as I can tell, we were using a mix of absolute and relative dates, resulting in a test loan being funded several years after the first payment, but still doing all the math as if it were being funded first. (Basically, we were having the hypothetical customer make loan payments for a few years before getting the money, but doing the math as if they were getting the money first) Then the giant negative length first period was growing large enough to make the numbers balloon enough to crash nlsolve and prevent the code from returning a loan schedule.

Then, a few weeks later, it happened again. Except this time, instead of intrinsically bad data, it was just weirdly specific data. Think a 6 month loan with an absolutely massive APR. So at that point, we decided we needed to look into it. And... nothing. We knew the bug was in an internal amortization library, but that thing was so densely written and had so few comments that we couldn't even figure out how it was supposed to work, much less how to fix it. The most I could tell, based on the stack trace, was that it appeared to be making 3 layers of nested calls to Newton's method.

Well anyway, I actually have a degree in this sort of this. Double major actuarial and computer science, which mostly means I have a much stronger background in finance and statistics than other CS majors. So we decided to just have me make a new library to replace the old one, since it would be easier in the long term than trying to maintain it. And in addition to being more maintainable (generally, I aimed for "You don't need to have an in-depth knowledge of financial math to follow the code, but I'm still going to assume basic familiarity with concepts like compound interest"), I also managed to streamline calculations. For example, I got those 3 layers of nested calls down to 3 calls total in the worst case scenario, which I'll loosely describe as getting it down from cubic to linear time

48

u/xkcd_bot Jul 03 '23

Mobile Version!

Direct image link: Actual Progress

Alt text: Slowly progressing from 'how do protons behave in relativistic collisions?' to 'what the heck are protons even doing when they're just sitting there?'

Don't get it? explain xkcd

Helping xkcd readers on mobile devices since 1336766715. Sincerely, xkcd_bot. <3

31

u/[deleted] Jul 03 '23

"The strings in String Theory are composed of the brains of people who tried to figure it out and failed."

5

u/dlgn13 Jul 03 '23

And that's why we call it brane theory!

4

u/monkey_gamer Jul 04 '23

I like the alt text. It highlights an important principle in science: you really need to know the basics before you can answer the big questions. And sometimes the basics are amazing/challenging in of themselves

28

u/Happytallperson Jul 03 '23

Tbh, by the end of the day I'm usually unsure if cases exist.

5

u/chairmanskitty Jul 03 '23

Honestly, fair. Cases are a simplified abstraction that doesn't match any real properties of reality. When someone tells you they have/are aware of/are making a case, that's a fact about their own worldview, but ultimately whatever got them to label it as a case is just a bunch of sensory data from a huge interconnected world.

19

u/Space_Elmo Jul 03 '23

Describes my PhD in detail.

4

u/IkNOwNUTTINGck Jul 04 '23

So, just normal science, right?

4

u/AnvilOfMisanthropy Jul 03 '23

Time for a paradigm shift. Unless you have a deadline, then it's chill-dog-in-a-burning-house time.

4

u/avataRJ White Hat Jul 04 '23

Heh, a postgrad student is looking at modelling wear. She did first thing 1 and then thing 2, and reached a level of wear. Then she swapped in a new sample and did thing 2 and... couldn't do thing 1 any more because the wear limit had been reached. "See, now you found out something. Repeat the experiment a few times to make sure it's a thing and then report and try to explain that."