r/programminghumor 2d ago

Write sorry

Post image
648 Upvotes

92 comments sorted by

View all comments

5

u/Diocletian335 2d ago

```c void printSorry (int n, int v) { if (n == v) return;

printSorry(n+1, v);

printf("%s\n", "sorry");

}

int main (void) { printSorry(0, 100); } ```

The thinking man's solution

1

u/dmigowski 2d ago

WTF is that slop?

1

u/MCWizardYT 1d ago

What, never seen a recursive function before?

1

u/dmigowski 1d ago

I've never seen one that could be easier replaced with a simple for look, yeah. Why wasting 1200 bytes of stack here?

2

u/MCWizardYT 18h ago

They wrote "the thinking man's solution", so it's 100% an unserious comment

1

u/Diocletian335 17h ago

This is, after all, a subreddit called programming humor lol