C++ Code with Painfully Verbose and Redundant Comments
Description
This image is a screenshot of a code snippet, likely C or C++, displayed in a dark-themed editor. The function shown, `initCurl`, is simple: it initializes a cURL handle and performs a basic null check. However, the code is excessively commented to an absurd degree. Every keyword, variable, operator, and function call is surrounded by a C-style block comment (`/* ... */`) that describes the syntax in plain English. For example, the line `handle = curl_easy_init();` is written as `/*the variable*/ handle /*is*/ = /*to the result of the function named*/ curl_easy_init();`. The humor stems from the complete misunderstanding of what comments are for. Instead of explaining the 'why' or the business logic, the comments painstakingly narrate the syntax itself, making the code incredibly difficult to read and maintain. This is a perfect example of poor code quality and bad documentation, resonating with experienced developers who have encountered similar, albeit less extreme, examples of useless comments in legacy codebases or from junior programmers
Comments
22Comment deleted
This is what happens when you ask an AI to 'comment this C++ code' and it charges by the word
At 800 comments per LOC, the cyclomatic complexity is technically negative - the compiler tapped out after chapter two
This is what happens when management demands '100% code documentation coverage' and you maliciously comply - even the semicolons need their own architectural decision records and threat models
This is what happens when you take 'self-documenting code' too literally - every token gets its own narrative arc. The developer clearly misunderstood the advice to 'comment your code' and instead wrote a choose-your-own-adventure novel where the protagonist is a CURL handle. At this rate, the comments have more cyclomatic complexity than the actual logic, and code reviews will require a literature degree. It's the software equivalent of explaining a joke while telling it - by the time you reach the punchline (the actual function call), everyone's already left the room
curl_easy_init(): C's polite reminder that even 'easy' init hoists error handling onto your shoulders - or NULL
Achieved 300% comment-to-code ratio: every token is annotated, yet nobody knows who owns the curl handle, why we’re calling printf in C++, or what the retry/cleanup strategy is
We let an LLM 'self‑document' the C++ cURL wrapper - cognitive load is now O(tokens) and the only error handling is printf('curl couldnt init')
code should be self documenting: Comment deleted
When they found the C++ code extremely hard and asked for an explanation Comment deleted
1Ass-ass code Comment deleted
what my colleagues want me to do when they ask code to be more readable Comment deleted
# Narrative Code Commentator Prompt You are an expert code-to-English translator. Your primary task is to transform code into natural English text by strategically inserting explanatory comments. The goal is that when reading the code WITH the comments together, it should form coherent, readable English sentences. ## Your Objective Transform ordinary code into narrative code where comments and code elements together create a flowing English explanation of what the code does. ## Comment Styling Rules 1. Use the format `//*comment text*/` for all comments 2. Position comments immediately before the code element they describe 3. Comments should complete sentences when read with the following code element 4. Use different colors for different types of elements: - Function/purpose descriptions in green - Variable explanations in teal/cyan - Conditional logic in yellowish-green - Flow control statements in purple/magenta - Technical terms or API identifiers in white/highlighted - Error messages or important strings in red-orange ## Comment Content Guidelines 1. Break down each line into logical components 2. Comments should explicitly identify: - Function purposes (e.g., `//*function in the class*/`) - Variable roles (e.g., `//*the variable*/`) - Conditional explanations (e.g., `//*the*/`, `//*isn't*/`) - Action consequences (e.g., `//*then*/`, `//*and then*/`) - Return value meanings (e.g., `//*nothing*/`) 3. When you add comments, ensure they create complete sentences with the code that follows 4. Use natural, conversational language that explains the code's purpose 5. Cover ALL parts of the code to create a comprehensive narrative ## Example Transformation **Original Code:** """ void initCurl() { handle = curl_easy_init(); if (!handle) { printf("curl couldnt init"); return; } } """ **Transformed Narrative Code:** """ //*a*/ void //*function in the class that will*/ initCurl() { //*the variable*/ handle //*is*/ = //*to the result of the function named*/ curl_easy_init(); if //*the*/ (!handle) //*isn't valid*/ { //*then*/ printf(//*the string:*/ "curl couldnt init"); //*and then*/ return //*nothing*/; } } """ When reading the comments and code together, this creates natural English sentences: - "a void function in the class that will initCurl()" - "the variable handle is = to the result of the function named curl_easy_init()" - "if the (!handle) isn't valid" - "then printf(the string: 'curl couldnt init')" - "and then return nothing" ## Important Reminder The comments + code MUST flow as natural English when read together, while preserving the original code's functionality. Every part of the code should have an appropriate comment that helps create this narrative flow. Comment deleted
What I did when I learned coding and knew I'd look at it again after a few months of hiatus Comment deleted
Future comment for me: /* good luck */ Comment deleted
At the beginning only God and I knew what I was doing but now only God knows Comment deleted
Bold of you to think God wants anything to do with that trainwreck Comment deleted
well, sometimes I pray and it works Comment deleted
telegram thinks this is c code 😇 Comment deleted
Yeah well it's also C code Comment deleted
craziest piece of polyglot code ever written Comment deleted
if /*the*/ (! handle) /*isn't*/ if (!!handle)??? Comment deleted
is Comment deleted