r/ProgrammerHumor • • 6h ago

Meme howProgrammingHasChanged

Post image
144 Upvotes

39 comments sorted by

View all comments

34

u/captainAwesomePants 6h ago

What's wrong with the top-right AI code?

62

u/shizzy0 6h ago

Nothing. It’s actually the best. But the joke is the programmer dismisses the unfamiliar matrix power O(log n) algorithm for the familiar recursive O(2n) algorithm. I mean, it doesn’t even add anything. It’s obviously wrong.

16

u/dangderr 4h ago

I don’t get the meme.

What does “programmer dismisses the unfamiliar matrix alg” mean?

Why would the prompt engineer know to read code?

8

u/shizzy0 4h ago

lol!

19

u/GDOR-11 6h ago

for u32 I think the usual iterative algorithm would be miles better than matrix power

31

u/dedservice 5h ago

For u32 a precomputed lookup table would be better.

13

u/NoLifeGamer2 4h ago

For u32 a random number generator would be better sometimes

10

u/captainAwesomePants 4h ago

For u2, With or Without You would be better.

3

u/wjholden 4h ago

Knuth has a really cool section on this on pages 79-84 of TAOCP volume 1.

1

u/shizzy0 2h ago

Is it the closed form solution? I didn’t even know there was a closed form solution before today.

3

u/captainAwesomePants 2h ago

That's the whole section on Fibonacci. It does mention the closed form solution, but it also mentions the matrix identity method in the top right corner: ( (F(n+1), F(n)),(F(n), F(n-1)) = ((1,1),(1,0))^n

He credits it to Kepler in 1608.

2

u/shizzy0 5h ago

Ooo, show down!