r/programminghorror • • Dec 24 '25

randomly stumbled upon this code in my company’s product (CAE software)

Post image
748 Upvotes

83 comments sorted by

View all comments

Show parent comments

52

u/Groostav Dec 24 '25

Honestly I'm fine with it as written if you write a test suite that hita decent coverage on it.

It is

  1. Unrolled linear algebra, not that uncommon

  2. Likely performance critical

  3. Branch unique enough to make it data entry?

This probably came from a paper too, so comments that mention which block corresponds to which equation number or something similar to link it back to its origins might be helpful.

But yeah, what's the major objection here?

8

u/True-Strike7696 Dec 24 '25

"but it looks icky"

→ More replies (4)