Skip to content
DevMeme
3269 of 7590
GameDev Post #3593 · source on Telegram

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

10
Anonymous ★ Top Pick 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
  1. Anonymous ★ Top Pick

    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

  2. Anonymous

    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

  3. Anonymous

    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

  4. Anonymous

    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

  5. Anonymous

    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

  6. Anonymous

    When your broadphase misses the pair but narrowphase finds double penetration - constraint solver's worst nightmare, pure /ouch

  7. Anonymous

    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

  8. @AlazarGetnet 4y

    Holy shit

  9. Deleted Account 4y

    long long ago; // in a galaxy far, far away

  10. @p4vook 4y

    https://github.com/hasyimibhar/gag/blob/master/src/Game/CollisionManager.cpp

Use J and K for navigation