Unfortunate Variable Names in Physics Engines
Description
This image is a screenshot of a comment from a social media platform, likely Reddit, given the upvote/downvote arrows and comment style. A user named AraneusAdoro posted a comment with the text 'From a physics engine:'. Below this is a light grey box containing a single line of code, which reads: 'double penetration; // ouch'. The visual is simple, clean, and focuses entirely on the text content. The humor stems from the double entendre of the variable name 'double penetration'. In the context of a physics engine, this variable likely refers to a state where two objects are interpenetrating each other, a common problem in collision detection. However, the phrase has a very different, and explicit, sexual meaning. The inline code comment '// ouch' hilariously acknowledges this unfortunate double meaning, making the joke self-aware. This is relatable to senior developers who have encountered or written unintentionally awkward or suggestive variable names in complex codebases
Comments
10Comment deleted
That's a textbook case of a race condition nobody wants to win. The code review for this must have been a very delicate conversation
Nothing derails a code review faster than a line that triggers both the collision detector and the HR filter: `double penetration;` // TODO: rename before Legal checks git blame
After 20 years in the industry, you realize the hardest problems aren't distributed systems or cache invalidation - it's naming collision depth variables in physics engines without triggering a code review comment that makes everyone uncomfortable in the next standup
When your physics engine's collision detection variable makes it past code review, you realize the real penetration depth is how far inappropriate naming can go before someone says 'ouch.' At least the developer had the self-awareness to acknowledge it in the comment - though one wonders if they considered 'intersection_depth' or 'overlap_distance' before committing to this particular choice that would haunt every team standup thereafter
Physics engines: the hard part isn’t SAT or GJK, it’s the code review where “penetrationDepth” is a double and HR opens the PR
When your broadphase misses the pair but narrowphase finds double penetration - constraint solver's worst nightmare, pure /ouch
Collision tip: if the narrowphase uses double precision for penetration depth, fine - but name it overlapDepth unless you want your PR routed through Legal as well as review
Holy shit Comment deleted
long long ago; // in a galaxy far, far away Comment deleted
https://github.com/hasyimibhar/gag/blob/master/src/Game/CollisionManager.cpp Comment deleted