Skip to content
DevMeme
5422 of 7590
CodeQuality Post #5944 · source on Telegram

The Absurdity of Self-Documenting Code Taken to Extremes

Description

A screenshot of a C# script within the Unity game engine editor. The code defines a 'GameManager' class that contains variables and methods with extraordinarily long and descriptive names. For example, a boolean variable is named 'ThisBoolMakesItSoThatTheGameHasHigherContrastForAccessibilityPurposes', and a method is named 'CallThisWhenThePlayerLosesHealthAndIfHealthGoesBelowZeroThePlayerWillDie'. This meme is a satirical take on the software development principle of 'self-documenting code,' where code is written so clearly that it doesn't need comments. The image pushes this idea to a comical and impractical extreme, highlighting the trade-off between descriptive naming and code readability/usability. It resonates with developers who have debated naming conventions and the appropriate level of verbosity in code

Comments

45
Anonymous ★ Top Pick This isn't just self-documenting code, it's a full-stack story. The compiler doesn't build it, it publishes it as a novella. Good luck hitting the 80-character line limit during a code review
  1. Anonymous ★ Top Pick

    This isn't just self-documenting code, it's a full-stack story. The compiler doesn't build it, it publishes it as a novella. Good luck hitting the 80-character line limit during a code review

  2. Anonymous

    I love how we micro-batched draw calls to hit 60 FPS, then stuffed every field with a 120-char “self-documenting” name - because why store the requirements doc in Confluence when you can cache-miss it in every dereference?

  3. Anonymous

    This is what happens when the PM says 'make the code self-documenting' and the junior takes it literally - now the variable names are longer than the actual implementation, and the code review tool crashes trying to display the diff

  4. Anonymous

    When your tech lead says 'make the code self-documenting' but you take it as a personal challenge to eliminate all need for comments, documentation, and human comprehension. This is what happens when you implement 'clean code' principles with the subtlety of a sledgehammer - variable names so descriptive they could double as user stories. At this rate, the next sprint will just be renaming 'i' to 'ThisIntegerRepresentsTheCurrentIndexInTheLoopThatIteratesThroughTheCollectionOfGameObjectsInTheScene'. The real kicker? This probably still compiles faster than a Gradle build, and the method names are *still* more concise than most enterprise Java interfaces

  5. Anonymous

    When your MonoBehaviour has CallThisWhenThePlayerLosesHealthAndIfHealthGoesBelowZeroThePlayerWillDie(), you’re not doing self‑documenting code - you’ve implemented Documentation‑Driven Development; the call stack is a user story and grep is a literary exercise

  6. Anonymous

    Immortality via MonoBehaviour: death state? Nah, just `currentHealth = maxHealth` - state machines are for mortals

  7. Anonymous

    Self-documenting code meets Unity serialization: the GameManager doubles as the PRD - rename one field and half your prefabs quietly reset

  8. @Sp1cyP3pp3r 2y

    i_hate_camel_case

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

      Isnt camelCase lower case at first char?

      1. @Sp1cyP3pp3r 2y

        mayBe

        1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

          Don’t worry I have a more cursed casing system

      2. @TERASKULL 2y

        yea, otherwise it's PascalCase

        1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

          Thats what I thought remembers me of VisualBasicTimes

      3. @trainzman 2y

        camelCase is, PascalCase is not

        1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

          I use a combination of both💀

          1. @Sp1cyP3pp3r 2y

            terminate yourSelf 👍

            1. @trainzman 2y

              Why, it's a common C# practice

          2. @TERASKULL 2y

            add some snake case To_spice_Things_up

          3. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

            Parameters and local/private variables are camelCase, Class/Interface/Function/Property names are PascalCase

            1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

              Private variables inside a class are camelCase with a _ prefix

              1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

                Now you can cancel me

            2. @azizhakberdiev 2y

              in assembly we use lowercase in any case

              1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

                Noice

              2. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

                To be fair we just pretend to care about casing yet we never use the same names with different casing. /s

  9. @Sp1cyP3pp3r 2y

    apart from math functions, they constantly need to reference Engine's library

  10. @TERASKULL 2y

    the gameplay logic is written like that, everything else is handled by the game engine. Unless you're fucked in the head and create a new engine in C++

  11. @posttrau 2y

    I hope this is not a real code but made just for a meme because it smells like a lot

  12. @trainzman 2y

    While Java uses camelCase for everything, it's common for C# code to use PascalCase for method names and camelCase for variables

    1. @Sava_SKk 2y

      classes in java are in PascalCase

      1. @trainzman 2y

        True yet not really relevant 3 days later

  13. @purplesyringa 2y

    nit pick: it's per se, not per say

  14. @qwnick 2y

    yes, just you :)

  15. @Supuhstar 2y

    [C.objective mostReasonableTokenLengths];

  16. @sin_fox 2y

    Tarkov sources leacked?

  17. @Dark_Embrace 2y

    if (health < 0) kill_player(); So 0 hp is not a death

    1. @sylfn 2y

      please use english in this chat

    2. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

      uint health = 100;

  18. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

    Pls yes also limit data size to 7 bits

  19. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

    Make one for no rust

  20. @hannybu 2y

    https://ideogram.ai/g/Jo7C5SzaSeWlpA-6ZwnOWg/1 here's the stuff - https://ideogram.ai/ prompt: protester holding a sign reading "Neural Invalidi!" there 25x4 per day for each gmail very good in fonts protesters can be replaced on anything i started to use it for communication :(

  21. @Sava_SKk 2y

    like Main

  22. @Sava_SKk 2y

    but methods and variables are in camelCase

  23. @Sava_SKk 2y

    void main, int playerScore etc

  24. @zherud 2y

    Why is health a float? Wtf

  25. @ageek 2y

    😂😂

Use J and K for navigation