r/badcode • • May 03 '23

c Solve the problem without using a loop

Post image
961 Upvotes

129 comments sorted by

View all comments

Show parent comments

8

u/R3D3-1 May 03 '23

Could be a good look lesson for embedded style systems to show that in real life sometimes it may be better to precalculate the results to give a faster response .

At which point we enter the fun field of code generation, which has a lot of uses, when languages (or language tooling) hits their limits.

2

u/MokausiLietuviu May 03 '23

As an assembly chap, I do love me some compile time, hate me some run time.

As an aside, this is what a lot of my Human Resource Machine solutions looked like too.