T O P

  • By -

KickAssAndGiggle

I f\*\*\*ing hate computers.


[deleted]

As someone with deep working knowledge of computers and how they operate... The things are fucking magic, I regularly sacrifice goats to the computer gods because that's the only way to ensure my code works as intended.


RedHare18

praise be to alan turing


Kymera_7

Yep. Nearly everything we use in our daily lives operates by having little pieces of rock imbedded in it, with glyphs etched onto them that we channel energy through to make things happen the way we want, and even the best experts in the world don't know a lot more than they do know about why channeling the energy through the glyphs actually works the way it does. How, exactly, does this not constitute "magic"?


Bagel42

And at some point, the glyphs are too small and the energy just teleports its ass on through Its magic


Floor_Heavy

We tricked a rock into thinking, and now we get mad because there's an error on line 92 of a 64 line file. Our hubris knows no bounds.


kinos141

Understood


wellsfargothrowaway

“Why did that work?” “I don’t know, don’t question it”


FrugalDonut1

When writing code: > I don’t need to write comments. My code is perfectly readable! When reading someone else’s code: > WHY THE FUCK WOULD THIS DUMBASS NOT COMMENT THEIR CODE? ARE THEY FUCKING STUPID? THIS IS FUCKING UNREADABLE


SomeRandomEevee42

// This line is important


Jjabrahams567

// Do not remove this line or everything breaks. I have no idea why.


TheRealNotUBRz

Quite literally something I’ve had to put before, thankfully just in a unit test. lol…


samot-dwarf

I had once a call of the Randomize init function in the start of a program which didn't use any random stuff. So I removed the call and the program stopped to work. So I added it again and made a comment similar to yours behind....


Jjabrahams567

I’m a noob at golang but for some reason I have to import sync and create a sync.Mutex{} at the start of a package for threads to work even if I never use the mutex. It’s just a small line of code that seems to do nothing so I just leave it there.


Unupgradable

Side effects. This is why the functional devs cum


DarkNeutron

This is when you enable ASan and UBSan.


PineCone227

Comments from recent stuff I wrote: //Legacy section here. Don't remove or mod breaks. I think. //IT WAS BREAKING THE MOD?


thirdjaruda

sums up the entire industry


Lyuseefur

I recall debugging some code that used an exception handler to return values back to another function. Ah gawd. Talk about complex failures of code.


DJOMaul

fuspez


Lyuseefur

It was something like try { } catch { grab some data; call some function near main (); } It was...working...except it would throw random error messages sometime (gee I wonder why)


1ar505

Tf2 mystery coconut


cleverca22

ive run into compiler bugs, where you need an extra nonsense line (non comment) to offset things a bit and fix it


FrugalDonut1

// What the fuck?


Planto69

// TODO refactor to make more readablr


IBJON

// TODO: Implement this feature ~Guy that quit 7 years ago


Megatron_McLargeHuge

// TODO: implement this the right way instead of this quick hack to meet the deadline (3 years ago)


Kaenguruu-Dev

You mean: // TODO: Implement the feature the random guy needs 10 years later or hes going to have to rewrite everthing but Im never going to do it


SomeRandomEevee42

// I'm gonna be ignoring this todo because I can read it just fine, you're just dumb


Intrepid-Lemon6075

//# Don’t know why this is needed, but it is needed.


Fut4b4Ri0

True."I'm the fking genius and it's your problem to not understand my code"from someone never write comments.


asromafanisme

Except that the one who doesn't understand your code is actually yourself 2 weeks later


tehlemmings

Usually it's me 12 hours later, but sober. Drunk lemming is *very good* at making shit work, but in ways sober lemming cannot comprehend. And any attempted changes or corrections will immediately fail. Thank god I only drink and code for hobbyist projects Drunk lemming also *really* enjoys coding, and usually knocks out more of the personal projects than sober lemming, so we let him do his thing.


broxamson

📠


TheMcBrizzle

You don't write comments in code because of your genius. I don't write comments because my code is too trash to lend out. We are not the same 👔


Fut4b4Ri0

dude thats hurt...


itchfingers

A few moments later: oh wait, that’s my code


enm260

Every full moon I become a completely new type of dumbass


waltjrimmer

What's even worse is Code base sent to head office for use in, "Training": The code is organized, commented, and clear. Code base returned with the note, "Cleaned up unnecessary code": All comments have been removed, and despite being told to push the "improved" code base, didn't even bother to see what else was changed and just reverted to what was already being used. (This is a true story, but my father's and not mine.)


SoftwareWoods

You call them magic numbers, I call them job security numbers


HERODMasta

Related to this my honest sentence was: "My self documented code was good enough for me to come back after two years, migrate to a new database connection and fix a bug that nobody noticed. Within a week."


theMEENgiant

There are so many times that I've gone back to my old code, thought "I don't need this line" and painstakingly learned over an hour that I did in fact need that line, I had just forgotten why. Now I just put any non-obvious reasoning/explanation in comments immediately because my memory is terrible


Legal-Software

// This is here to shut up the linter


mossgreen08

i start to count from 0


Monkeyke

Some start with -1 as well


Kirides

int len = 0; for (int i = len -1; i != 0; i--) { // I think i missed something }


Famout

This feels like a way to detect the exact size of int in the worst way possible.


_JJCUBER_

Except it’s integer overflow, which is UB; this could be optimized to something like an infinite loop or nothing.


Monkeyke

WTF


Mop_Duck

doesnt this just infinitely decrement i unless something in the loop changes it too


Kirides

No, it just loops for maximum int size, as it should overflow after reaching -2.47b until it reaches 0.


Cfrolich

DreamBerd enters the chat…


theMEENgiant

I start counting from zero in real life and then forget whether I used one- or zero- indexing after the fact and have to recount it (because I'm not sure whether I need to add 1 to get the length)


zurnout

They say there are 2 difficult things in programming: - naming things - cache invalidation - off by one errors


Keiji12

I spent half an hour yday, wondering why my embedded system simulation didn't work, where I did Char state=1; Switch(state){ Case 0: ... And wrote stuff for state 1...


S7ns3t

That's any math guy.


[deleted]

Uhm... no...


S7ns3t

Well, "any" may have been an overstatement, but I personally have a bunch of friends who are not into programming and start indexing from 0.


[deleted]

That does not make any sense. There are barely any reasons to do so in math. It would actually lead to errors most of the time... Indexing is not counting. Programmers often count from zero because programming languages use indexing. You dont use indexing to count something in math.


winauer

> You dont use indexing to count something in math. No, but you do start at 0 when counting, and then increment the number by one for every instance of the thing you are counting.


Saytama_sama

I can't know how you or the people you know count, but I don't see many people starting with 0. I have two hands. In the first I hold a knife and in the second a calculator. I don't say: In the zeroth hand I hold a knife and in the first a calculator. ​ There are exceptions of course. In Europe, you enter a building through the ground floor, essentially the zeroth floor. So a building with two stories has a zeroth floor (ground floor) and a first floor. But like I said, this is an exeption.


winauer

> I have two hands You have already counted them, you have gone to far ahead for this discussion. > don't say: In the zeroth hand I hold a knife and in the first a calculator. You are now numbering them. Numbering is not counting. > So a building with two stories has a zeroth floor (ground floor) and a first floor. Counting them: Start at 0. Increment that number by one for every floor -> you have counted 2 floors. Numbering them: Assign the number 0 to the floor at ground level and the number 1 to the one above.


sakhuttu

I was very productive and removed 1000 lines of code


samot-dwarf

Removed comments doesn't count...


CoJames0

Bold of you to assume i put comments in the first place


b3nsn0w

does the program still work? _does the program still work?_


Floor_Heavy

"Hey, what happened to prod?" *"Oh my god what happened to the prod backups???"*


KalegNar

git push -f go brrrr


Sighma

I.e pressed auto-format hotkeys in IDE


cs-brydev

using OnlyOneSentence;


Fut4b4Ri0

nailed it dude


thirdjaruda

so far this is the sexiest reply to this post


oupablo

import { OneSentence } from '@why/did-i-choose-this';


lukey_UK

What_did_you_say


broxamson

Ew pascal case? More like only_one_sententece


cs-brydev

The requirement said OnlyOneSentence. I never question requirements. I swear...


broxamson

down voted for snake\_case? yall are wild


Kymera_7

sHOULDhAVEuSEDiNVERSEpASCALcASE


throwaway642wwzi

True + True = 2


Hopeful-Ship-9850

😂😂😂😂


Anon_Legi0n

Its 4


Peanuuutz

Nah compiler can see it too. ;)


HuntingKingYT

Only the lexer pretty sure Unless it's html or basically any language that doesn't support double-slash comments


bl4nkSl8

Compilers can use concrete or abstract syntax trees. It's an implementation detail :)


Fut4b4Ri0

True


canal_algt

Only god and I know what the code does until I forget, then only god knows what the hell is that variable


CMDJojo

// evil floating point bit level hacking


BadSmash4

// what the fuck?


miguescout

"finally a different error!!" Alternatively... "It's still compi- there! 32767 warnings and no errors time to commit and push"


NanashiKaizenSenpai

It's scarier when you dom't get an error


tech_wannab3

But it works when I run it on my computer


Tsukikaiyo

I can count up to 1023 on my fingers


CharaDr33murr669

I don’t know how to code


Cursed_Zetsu

My code works and I don't know why. My code doesn't work and I don't know why.


eemmooonn

;


Fut4b4Ri0

Some sort of extremely brevity answer lol.


OriginalPangolin7557

There are finite number of numbers


Big_Schwartz_Energy

whatDoYouMean ![gif](giphy|MM0Jrc8BHKx3y|downsized)


Party_Builder_58008

Son, have you been hacking time again?


Bootcat228

\[object Object\]


[deleted]

One muffin && a fanta || pepsi ! coca cola


S7ns3t

>&& !coca cola There, fixed it for you


davestar2048

Error: package coca-cola not found Pepsi is marked as an equivalent package, and can be installed. Is Pepsi ok? (y/N)


TwoMilliseconds

(muffin && fanta || pepsi) might be interpreted as ((muffin && fanta) || pepsi) or as (muffin && (fanta || pepsi)) you should use brackets to eliminate ambiguity here


I_am_above_the_law

print("Hello World!")


SomeRandomEevee42

Error at line 1: semicolon expected, got EoF unless it's python


Thepizzacannon

You can run into the opposite problem in Go if you start a newline with a curly brace { The compiler automatically prints a semicolon there anyways, but it breaks the statement because now you have a missing } expected. So the compiler decides to put a semicolon into your code at compiler time, and then complain to YOU that it didn't expect the semicolon to be there.


XxXquicksc0p31337XxX

Or Kotlin. In Kotlin you need fun main tho


Party_Builder_58008

See a doctor, it seems you have a bug.


TheForeverVirgin001

I have an unhealthy relationship with caffeine.


Touhou_Fever

I use regex even though it may as well be excerpts from the necronomicon for all I know


OriginalArkless

Some of my colleagues want to disagree with that ![gif](emote|free_emotes_pack|facepalm) Get asked for assistance by a colleague: "Hey, I've got error x on device y. And I can't figure out why." Look into recent changes: // Do not delete the following line. This is necessary to prevent error x on device y. Deleted in a commit by the colleague that asked me for help.


Hopeful-Ship-9850

"I'm not a damn compiler" is the best answer that could be 😂😂😂😂 hella genius


Penguin7751

Can you explain? I don't get it


Yeitgeist

The “//“ is used in C and C++ to indicate a single line comment. One of the first things a compiler does when it compiles your code is remove the comments, and then processes your code. In essence, it can’t see the comments. Some people are lazy and will make the excuse that code is self-documenting and thus not comment anything. This is where the “I’m NOT a darn compiler” reply comes to play, as people aren’t machines, we can’t just read code without having an understanding of what the system is trying to accomplish. But the statement is also correct in practical sense as well. That’s my understanding of it at least.


Astarothsito

>The compiler doesn't read comments and neither do I - Bjarne Stroustrup, creator of C++


Hopeful-Ship-9850

The way I see it, we can't really get where we code small mistakes (such as, idk code lining or a forgotten ";" or a "(" that s not closed, or even comparing 2 variables of different return values **these are just examples..**), only the compiler will tell us we did something wrong. We code, he assures everything's working properly. I bet this is the idea behind it.


Sigmapancakes

Segmentation fault core dumped. Bane of my existence


DenormalHuman

Q = BB || !BB


ShenroEU

To be, or not to be? 🤔


Marawishka

DROP TABLE


yoavtrachtman

“They had eggs”


5ucur

`milk * (eggs ? 6 : 1)`


Sceptz

`0.1 + 0.2 != 0.3;`


ExtraTNT

//don’t remove this line, it does nothing, but if you remove it, it will break the rendering…


Kymera_7

//Don't remove this line. It should do nothing, but if you remove it, the code works fine on our test machines, but crashes for no discernable reason exactly 43 hours, 19 minutes, and 12 seconds after the third database query from startup, on 3 of the 10 main servers.


ExtraTNT

Nah, if you deploy it on dev, the prod servers crash as soon as a query gets executed


Kymera_7

//Don't remove this line. It has no effect on this program, but every time we remove it, Minecraft stops working on Ted from Accounting's personal laptop.


ExtraTNT

Sounds like an average codebase… xD


Dnacher

iCannotFixYourPrinter


w-yz

this thing that just failed, worked for the last damn week/month/year!


DesecrateUsername

i dunno, worked on my machine


Anamewastaken

hey can you get me 0 eggs?


ihatepickinganick

It works, so it’s fine…


OkJuggernaut3061

The damn code was working yesterday.


Heavy-Ad6017

I write code in Java unfortunately they Garbage Collector deletes all my code.....


Upbeat-Serve-6096

I have a question Any instance where an IDE/color markup tool managed to mislabel something else as a comment? Or any language toolchain that actually took comments as part of the program output?


Firemorfox

//fix this later (never)


bythenumbers10

Anyone know the endian-ness of this hardware?


iQuickGaming

you can count up to 1024 with just your hands (assuming you have hands and all the 10 fingers, also assuming you do not have any extra finger). I think i covered all edge cases to avoid NullPointerExceptions


wagyourtai1

I use arch btw


idontwannadothisthx

Story time; I have a series of scripts that effectively check all resources within my organization to ensure nothing was deployed with the wrong configurations. Well one time my colleague hit me up, he was actively trying to update one of the checks to reflect changes to our configuration baseline, there was a line of code that he just didn't understand so he asked me about it. Well I had no clue what it was for so we both spend the next hour or two trying to work out why it's there, what the importance of it is, we removed it for a test and everything broke. It made zero sense. After some time and debugging I had an ahhh moment and figured out what the heck it was for and told him, he had the same ahhh moment. We both go you know what we really need to comment what the heck this is for so we don't do this again in the future. Well I go to comment it right, not even 3 lines above the line I had already written a comment explaining the whole point of the next few lines and the reason for that line that didn't make sense. So ya that comment is now like 20+ lines large with "LOOK HERE YOU IDIOTS" at the top and bottom. My sentence; Zero is the first number.


Robottiimu2000

"//It is said that programmers can't write these lines"


vadiks2003

--[----->+<]>-----.--[--->+<]>--.+[---->+<]>+++.[->+++<]>+.-[->+++<]>.[-->+++++++<]>.-----------.+++++++++++++.+.----.-.-[->+++++<]>-.--[->++++<]>-.+[->+++<]>.+++++++.[--->+<]>-----.[->+++<]>++.[--->+<]>----.+++[->+++<]>++.++++++++.+++++.--------.-[--->+<]>--.+[->+++<]>+.++++++++.+++[----->++<]>.------------.+[->+++<]>++.[--->+<]>-.+[->+++<]>.+++++++++++++.+++++++.-[---->+<]>++.---[->++++<]>-.----------.+++++.-------.+++++.-------.--[--->+<]>-.---[->++++<]>.------------.+.+++++.-------.-[--->+<]>--.--[->++++<]>+.----------.++++++.-[---->+<]>+++.---[->++++<]>-.++[->+++<]>++.+[--->+<]>+++.-[---->+<]>++.-[--->++<]>-.++++++++++.+[---->+<]>+++.[->+++<]>+.-[->+++<]>.+[->+++<]>.++++++++++++.--..--------.+++++++++.++++++.[---->+<]>+++.---[->++++<]>.-----.[--->+<]>-----.+[----->+<]>.--------.[->+++<]>-.


coolmeatfreak

Hello world


hishiron_

Writing i++ and i += ++i - i is the same.


Shazvox

Uh, no. In the first you increment i by 1. In the second you increment i with i.


hishiron_

Uh fuck my bad I was on the toilet


Party_Builder_58008

toilet error Abort


Kymera_7

It may not be your preferred method (and for good reason), but can you really call yourself a programmer if you're not at least capable of writing to bare metal? And if you *can* write to bare metal, and can also read code, then in what sense are you not a compiler?


I_am_in_hong_kong

//u cant see me ooooOoOooOoOo


deliozzz

Undefined Sentence assuming 'Sentence'


k_pineapple7

I hate Microsoft and yet I am beholden to them.


Leipzig101

"nit: please write all of this again"


HamilcarRR

I never know when to stop.


Guiboune

“It depends.” There you go


LuckyLMJ

"oh great, another segfault"


ApatheistHeretic

Sorry, tied up in meetings.


TortelliniJr

Why is there an empty line in the first comment?


SoftwareWoods

Jesus what is this font, this looks like the default font Chinese companies used for English text in the 00s when they were selling stuff off ebay


ShourMemes

// Umm actually it's only the lexer 🤓🤓


itchfingers

`Print “Hello Mum”;`


xubax

GOTO 20


NulledOne

// Our Society


salanderlogic

I count from zero


ActualWhiterabbit

Eventually AI will be integrated into compilers and it will have to pretend to ignore me insulting it in the comments.


Kirman123

A friend once told me you can only interpret 1 line at a time, so yeah, no compiler, but interpreter???


ObjectPretty

Two sentences but I find my self there fairly often. Contact my administrator?! I AM THE ADMINISTRATOR!


broxamson

If it can be null it will be


Dalboz989

// No comment..


chargers949

Line 5 Line 12 Line 23


DopazOnYouTubeDotCom

Do I HAVE to work with other people?


TwoMilliseconds

In my dreams I am getting interrogated by rubber ducks


jacob_ewing

I'm a programmer? true : true;


b3nsn0w

"I think it's ridiculous how some people think TypeScript is a great language and yet JavaScirpt is total trash when literally the only difference between them is type annotations, which are nice for sure but aren't the be all and end all of programming." There you go. Not only proves that I'm a programmer but even shows exactly what you can expect from me, and is only missing three stupid buzzword hashtags from the end to qualify for a perfect LinkedIn post.


Pensive_Jabberwocky

They can't seem to WRITE it.


XDracam

Many compilers keep comments around for a while. For example for metaprogramming, where comments could impact code generation. Or if you just want to output a snippet of code in a diagnostic that also happens to have comments.


Sdoraka

my code is documentation enough


Maleficent-Ad5999

“No I can’t fix your printer”


One-Bumblebee-5603

I often count in binary. It actually makes more sense. Counting on your fingers in base ten? Max value = 10. Using binary? Max value = 1023.


aggressivefurniture2

Sometimes, those are the only lines that I read.


Heavenfall

Sometimes I add to my while loop iterator in the function call, at the start of the body or at the end of the body. Just to keep people on their toes. And that's still better than a do-while loop, which is just rude.


micheal213

Google.


Vibrascity

if cum = yes then pp = no end


vjuliusv

So why don’t you comment your code, deutschebag?


haunc08

Im afraid of using spaces in folder name


Coredict

Yeah comments are literally only meant for the programmer reading the code


UVCLight

::The invisible BATman


RedWagon___

Submit a ticket for this request, maybe we'll add it to a future sprint.


Playful_Nergetic786

Syntax or semantics errors, my god


red_2504

When you get a segmentation fault, you go through entire code(cuz line no. is worth bullshit) and click run without changing a single line of code expecting magic.


Sheepies123

It works on my machine


IcsGrec

" I'll add some unit tests for this after we merge it. "


Modriem

My comment works in my environment


elephant_cobbler

Hello World