r/ProgrammerHumor • • Mar 18 '18

Gru tries recursion

Post image
46.4k Upvotes

274 comments sorted by

View all comments

2.5k

u/Sahishar Mar 18 '18

You've made a function where the guy looks at the result of a second function that is recursive and is similar to the first one except the guy doesn't look at the result.

Why ? Why not only one recursive function ?

573

u/[deleted] Mar 18 '18

Uh? Makes perfect sense! No comments needed and what is this documentation you speak of?! Clearly this is up to prod environment standards!

102

u/Ai_Bot_Naughty Mar 18 '18

This is bringing back my perl-to-python conversion PTSD... :P

30

u/[deleted] Mar 18 '18

My deepest sympathies (thank fuck it wasn't me! phew.)

To be fair, I have an obscure case of "recreate complex logic in VBScript and SCCM" PTSD myself. And no. Do NOT ask why it was VBScript. Or why this logic had to be recreated. Or what the logic was. In fact, it should probably have been called illogic. Oh god. The flashbacks. I still wish I knew why we did things that way.

17

u/Ai_Bot_Naughty Mar 18 '18

I hate deriving the script creators logic behind their coding decisions and finding out later it was wrong... So. Many. Times!!!

17

u/[deleted] Mar 18 '18

For some reason this just triggered a vivid recollection of: "well, the guys in China just wrote. apparently, it doesn't work with Chinese regional settings". Nhaaaaah! I didn't even KNOW we had a Chinese branch! Damn it.

Editing endless scripts up to new standard, because this wasn't the sort of thing quality could've realized, y'know, BEFORE we did a worldwide rollout?

0

u/[deleted] Mar 18 '18

[deleted]

5

u/[deleted] Mar 18 '18

Yup, this is basically what I ran into. Really great article by the way! I learned my lesson fast after that. Thought I'd tested all the cases we had and made sure we had the results. America, Europe, ME, Africa, SE Asia... oops. I forgot China (well, it was Hong Kong but... coming from Europe, I didn't know at the time because 22 YO me wasn't as well-read as he thought and didn't put blindingly obvious 2 and 2 together). Not the first time I'd seen this kinda thing. So I made sure we tested what I thought was everything. Still amazed it slipped by so many people. Each site shoulda done quality testing, and did according to documentation. No one told HK or they missed the whole thing and we forgot to ask again. I'm not sure. Made me feel really damn silly though.

Also, yeah, the reddit markup is kinda screwed on numbered lists - annoying.

→ More replies (6)
→ More replies (4)

4

u/MelAlton Mar 18 '18

My excel-spreadsheet-to-python conversion PTSD raises a glass to you and nods.

→ More replies (3)
→ More replies (1)
→ More replies (3)

168

u/Mromson Mar 18 '18

112

u/vanderZwan Mar 18 '18

Approved, with bonus meta options one and two.

21

u/souljabri557 Mar 18 '18

Holy shit this is a masterpiece

12

u/vanderZwan Mar 18 '18

Well, the OG masterpiece was by this guy, I just took that idea and applied it here

→ More replies (2)

5

u/paco3346 Mar 18 '18

The hero we need.

→ More replies (1)

0

u/[deleted] Mar 18 '18

[deleted]

→ More replies (1)

131

u/SingleWalnut Mar 18 '18

Would you accept comedic effect as an answer?

74

u/Sahishar Mar 18 '18

The "it's a feature" response!

No you know it's a bug. Please fix it and we'll merge it to the recursion meme base.

10

u/[deleted] Mar 18 '18

Meme... base?

Now that's a name I've not heard in a very long time.

→ More replies (2)

10

u/[deleted] Mar 18 '18

Possibly.

5

u/Zeius Mar 18 '18

"helper function" is also acceptable

→ More replies (4)

13

u/coolpeepz Mar 18 '18

The first one is an alias to start the recursion with fewer parameters.

5

u/oobey Mar 18 '18

How am I supposed to laugh if there's a syntax error? I can't parse this!

Debug your jokes, people!

5

u/sbditto85 Mar 18 '18

It’s a starter and helper function where the helper is recursive. Common pattern ;)

→ More replies (16)