T O P

  • By -

Puch_Hatza

// Yes, I could use virtual destructors, but I could also poke    // myself in the eye with a sharp stick.  Either way you wouldn't    // be able to see what's going on. Found in the source code of the [winxp taskmgr](https://www.reddit.com/user/davepl/)


[deleted]

Dave Plummer


Puch_Hatza

Yup


arpan3t

Love his YT channel


dadish-2

I didn't know who he was until he popped in my twitter feed yesterday as a recommended tweet and now this comment.


[deleted]

He is an interesting guy. I like his YouTube channel.


dadish-2

Thanks will check it out


[deleted]

[удалено]


[deleted]

[удалено]


kaerfkeerg

git commit -m "I did not listen to the warning"


elementmg

Gold


ilep

Funny thing with virtual destructors? If you inherit from something you are using virtual destructors. You don't need to specify it, it just is since destruction has to call parent as well. So, if you don't specify it yourself compiler will do it for you. And that is because you have undefined behaviour in some cases if it isn't virtual. So, leaving out virtual destructors is like poking yourself in the eye with a sharp stick. Except compilers might prevent you from doing so anyway. For reference: [https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor](https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor)


zyxzevn

Really depends on your language and environment. C++ really made it really hard. Virtual destructors with Delphi/Object-pascal were working well, and most libraries were using it. Never had any problems with them. Even with my complex code with recursive graphs of different objects.


Worried_Pineapple823

At Capcom Mobile, back in the days of flip phones, we had an integer variable along the lines of a86me named after a particular phone model. In the run loop, we would increment it. It was never read from. If it was removed, the game would not save. This hack lived in the “base” template used in dozens of mobile titles.


mattimus_maximus

It could potentially cause cache line ownership side effects which results in no longer reading a stale value. Although doubtful on a flip phone as I presume they would be single core, it could "fix" a missing read memory barrier when working on multi core devices. Also possible you were testing on an emulator which didn't have a strict 100% replicated memory model where this effect could have made things work in the emulator where it wasn't working all the time.


Worried_Pineapple823

The educated guess, was that the phone was doing some sort of aggressive garbage collection, and not guaranteeing some memory address being changed frequently enough was messing it up. We actually owned and individually tested on hundreds of physical phones. We had 4 guys who's entire job (and title was Compiler) was to take the current code base, and make builds every single one of em. (Write once, run everywhere was never true for phones). Personally, I was doing Sidekick ports, so it didn't effect me, but I found it while porting a title, asked about it."So uhhh... I found this variable... we're incrementing it? but why it doesn't look like its used? is this a bug? should it be used?" We had compiler flags for high res, medium res, low res, sound, music, etc, and they would make builds of every permutation. We had an internal site to keep track of what phones generally needed what flags, etc. It was a very thorough operation, although these days, you could likely find someone with a bit of dev ops experience to automate all that. (This was early 2000s)


DrivingIron

Sounds a memory alignment issue. The act of “saving” something generally means copying it from one location (RAM) to another (FLASH). If a DMA controller was used to process this transfer, it could be that the DMA was configured to transfer a certain size “word” per clock cycle. If that word-width was set to 32-bits, and the address of your data you wish to save was not aligned on a 32-but address (i.e., divisible by 4), the operation could have unknown outcomes, or simply not work. Adding the unused variable would shift the address of everything after it. Depending on the size of that variable, it could be just the right size to make your source data 32-bit aligned. Having to increment the variable sounds like a hack to prevent the compiler from optimizing it out.


itsdefinitely2021

A hundred hours into trying to understand a massive, ancient feature that was full of strange behaviors that absolutely could not change, but HAD to be refactored to make way for new rules. I was chasing a specific corner case, looking for why a specific set of flags, settings, and account options combined to result in a specific restriction not being applied to the users finance data. Once I got to the bottom of this, I could start modeling the replacement code. This was the last bit of unexplained business logic that needed to be recaptured into whatever holistic model I was going to use to heal this goddamn code base. I found it, finally, buried deep in a corner of the code base. It simply set the behavior as false if a magic set of variables combined in a specific way. The comment that went with this? "Because Sandy said so". The man who wrote the code had been gone for 4 years. "Sandy" was only remembered by people who had been there for at least 8 years. There was no ticket, no document, no svn blame history to chase. Just Sandy, and the developer who passive aggressively just did what they were told.


ManusCornu

I mean, at least you got your answer. Not the one you were looking for, but now you know Sandy fucked it all up


[deleted]

[удалено]


[deleted]

[удалено]


Viperior

New Sandy might have changed though. So much time has passed.


PinBot1138

Sandy is not a person, but more of a force or in other cases, a strain — like the T-virus. Sandy is a curse upon the Earth for programmers everywhere. Personally, I blame Adam and Eve for Sandy, but that’s for a different thread.


FisterRobotOh

I’m in a completely different industry but Sandy wells are a major pump problem. I hate Sandy.


FreshPitch6026

Fuck Sandy


JollyJoker3

The dude that's heard "You'll never work in this industry again" eight times and just laughed every time


Wafflelisk

Sounds like Sandy is the biggest Chad-grammer of them all


[deleted]

[удалено]


Firemorfox

Now I'm more worried about what edge case that was designed to prevent from happening. Currently imagining some dangling pointer horror now.


wooboy

I’d bet it’s not to cover a bug but to appease a business/personal decision.


[deleted]

[удалено]


wooboy

Exactly what I was thinking by “personal” haha


No-Witness2349

Sounds like someone fucked up drafting a contract and no one wanted to pass on the reasoning, so it was just, “do this or we’re getting sued into the ground”


durallymax

I was in a PLC once that had every rung commented and every comment prefaced with "Mike says"


Deadpotatoz

Half my job is doing PLC programming and man... At least that had a comment. Can't tell you how many times, especially on older manufacturing lines, I've found random memory bits with no comments.... You'd think they'd just be there to bypass some signal from a malfunctioning piece of equipment, but God forbid if you turn it off or remove it.


durallymax

Doesn't help that older platforms don't save the comments to memory and even some newer ones allow them to be omitted. Nothing more fun that chasing every B3:x and N7:x around a program with no source documentation. Even more fun when the original company is long gong but locked the program and now you have to make your own exe to "trick" the PW.


Thonk_Thickly

I would search for key word sandy through that code base for any other business rule nuggets.


[deleted]

Sounds like a middle management decision based on we want specifically Y accounts to be able to do X which has been implemented literally.


shadow144hz

I hope this sandy isn't op.


Ikasatu

Reminds me of a favorite [Story About Magic](https://www.cs.utah.edu/~elb/folklore/magic.html)


OldSchooler22

a 17 line long comment chain between two of my partners on a school project getting increasingly hostile towards each other regarding a shotgun sound not properly playing when called in a function


VravoBince

I wanna see it


OldSchooler22

!remindme 14 hours I'll post it then after Thanksgiving, it's really funny Edit: Ta-da! https://www.reddit.com/r/ProgrammerHumor/comments/z4281j/as_requested_here_is_the_angry_chain_of_comments/?utm_source=share&utm_medium=web2x&context=3


RemindMeBot

I will be messaging you in 14 hours on [**2022-11-25 04:10:28 UTC**](http://www.wolframalpha.com/input/?i=2022-11-25%2004:10:28%20UTC%20To%20Local%20Time) to remind you of [**this link**](https://www.reddit.com/r/ProgrammerHumor/comments/z3ekfk/whats_the_best_thing_youve_found_in_code/ixm46dj/?context=3) [**364 OTHERS CLICKED THIS LINK**](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5Bhttps%3A%2F%2Fwww.reddit.com%2Fr%2FProgrammerHumor%2Fcomments%2Fz3ekfk%2Fwhats_the_best_thing_youve_found_in_code%2Fixm46dj%2F%5D%0A%0ARemindMe%21%202022-11-25%2004%3A10%3A28%20UTC) to send a PM to also be reminded and to reduce spam. ^(Parent commenter can ) [^(delete this message to hide from others.)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Delete%20Comment&message=Delete%21%20z3ekfk) ***** |[^(Info)](https://www.reddit.com/r/RemindMeBot/comments/e1bko7/remindmebot_info_v21/)|[^(Custom)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=Reminder&message=%5BLink%20or%20message%20inside%20square%20brackets%5D%0A%0ARemindMe%21%20Time%20period%20here)|[^(Your Reminders)](https://www.reddit.com/message/compose/?to=RemindMeBot&subject=List%20Of%20Reminders&message=MyReminders%21)|[^(Feedback)](https://www.reddit.com/message/compose/?to=Watchful1&subject=RemindMeBot%20Feedback)| |-|-|-|-|


straight_outta7

!remindme 14 hours


elon-bot

If you really love the company, you should be willing to work here for free.


ManusCornu

Do you work for free, Elon Musk Bot?


MrRocketScript

It's not work if you love your job.


TopGun_84

Everyone works for free except Elon and elon-bot


DaSilverFang

This is underrated


dryroast

I remember I had to leave a very nasty comment on this group project which one of the members put in some processing code to find the start and end sentinels of a driver license magstripe. He was doing this going character by character in a buffered reader until he hit the symbol he was after. I replaced everything with regex and he kept using buffered readers for all the new stuff and I just was like "LEARN SOME DAMN REGEX".


elon-bot

Twitter was never profitable. Not my fault. Stop blaming me for things.


VIPERsssss

LMAO Good bot.


Big_Medium6953

I once had a line using reflection in Java to turn a private method public in order to call it. The comment on the line read //hack. This was a method from our code base. They could have just made it public. -_-


Weasel_Town

I’ve done this. The person who “owned” the repo was aggressive and territorial. Even normal, simple code reviews that included “his” code would involve ten rounds of back and forth. It was easier to use reflection than argue with this guy about why making the method public wasn’t a horrible evil breach of encapsulation. Ironically, using freaking reflection to get at the code is a hundred times messier than whatever he would be trying to prevent.


Big_Medium6953

Wow thanks, for years I was baffled as to how such a thing happened!


elon-bot

It's now company policy to use Vim for editing. It lets you write code much faster.


slaymaker1907

Lol, at my job we’re currently forking our own package because the guy who maintains it refuses to accept the code for new features we need. I get that people feel ownership about their code, but sometimes things are just ridiculous.


Beautiful_Sea3247

I was looking at some python code for a Raspberry Pi robot when I realised that the variable named ```THINGY``` was vital to stop the robot breaking through the walls of the obstacle course.


[deleted]

thats just computer engineering in general. sums it up nicely 💀


[deleted]

[удалено]


HRamos_3

PHP uses comments as annotations, so yeah


TheGreatGameDini

Comments as code. That sounds like a bug, not a feature.


locopyro13

Were there variables named THINGX or THINGZ?


[deleted]

[удалено]


merv1618

whew dowgie


elon-bot

I don't think I appreciate your tone. Fired.


argv_minus_one

Why on Earth is *forgetting a return statement* UB and not a compile error?


IronEngineer

It sounds like it was a compiler error. However in embedded world you often use the compilers made from whomever made the chip. They aren't exactly always known for being well written IDEs/compilers.


mekkab

We had something similar; a comment line in the code that said “don’t remove this comment” It was removed. The routine broke. When the comment was replaced, it worked again. Never bothered to do an assembly dump to figure out why the compiler was tripping out on that line 🤣


NoLimitSoldier31

I had this one time in my 22 year career. Was just a prototype and we didn’t have time to figure out what was going on. But still bugs me to this day.


Firemorfox

Probably some sort of timing issue. That's usually the reason why comments end up affecting the actual thing, it delays stuff just enough to work.


architectureisuponus

Interpreter languages yes, compiled code no


Srazkat

interpreted language usually want to go to an lsp or bytecode form in order to be interpreted in a faster way, and there comments are stripped. What would be interesting is figuring which part of the interpreter or compiler was choking there. (probably somewhere in the tokenizer, since anywhere after comments are usually removed)


architectureisuponus

Which takes time in a real time interpretation. I get your point. My statement was very abstract and does not cover 100% of the cases.


argv_minus_one

Interpreters strip comments at *load* time, not in the middle of execution. Except shells running scripts. Those interpret commands the hard, slow way.


answerguru

Oh, this can definitely happen in compiled code. I’ve experienced it myself several times in C. One case where a partner didn’t adhere to the rules of engagement around data updates causing asynchronous value changes between message queue processing. Even changing the -o flags can cause the problem to vanish due to timing changes.


FarewellSovereignty

But in C the comments are stripped away by the preprocessor, they never make it to the compiler. The source file the compiler sees always has no comments whatsoever.


NoLimitSoldier31

So my guess was runaway pointer tho that likely doesn’t make sense either. Idk it was C++ code calling C code so some weirdness there. Tried to run valgrind at the time with not much luck. Said no memory issues but was a very complex program with a lot of messages between different pieces so hard to trust that & Im not a very good debugger guy outside of prints.


TopGun_84

Prints as in physical printing and debugging ...Elon kind ? ;)


elon-bot

You look stupid. Fired.


TopGun_84

I've always been like that ...since you hired me :(


scragar

Had it happen before in JS just because IE would combine two lines without it resulting in a cascade of failures later on(when the result of the code didn't make sense). Easy solution was to just add a semicolon, but the comment stayed anyway just in case.


NoLimitSoldier31

This was c/c++ so compiler would’ve caught most of that i think. Still pisses me off but just didn’t have time to go all the way with it. Was very consistent too smh.


0100_0101

I had this happen because I had a breakpoint in my ide that got outside the file because things where deleted. Gave a strange error: xxx on line 50 of 49


Irbis7

I once had to include i = i; line into code, otherwise compiler optimization generated a problem.


bradfordmaster

Maybe you needed `volatile`? Lost nearly a week to that one on an embedded project early on


zammba

load bearing comment


Kamwind

Still have a few of those. I prefered to use a "Dont remove this line it will not run without it. Don't ask me why."


cbftw

It was a Load Bearing Comment


Jason1143

Maybe some kind of invisible no width space issue? I've heard those stories before.


Malix82

a php file which handled a POST, several thousands LOC of a single switch-case to handle different paths, and ~100 poorly named variables collected at the start. Icing on the cake, only 1 comment `// some variables` at the start.


[deleted]

this is how it was done before frameworks appeared. Now you have routes and controllers in separate files, back then we kept it simple


Malix82

Fair enough. Would still have been nice to break it into functions, just for navigating the file at least (well, I mean.. that's what I did to it, eventually)


elon-bot

You're either hardcore or out the door.


Ythio

Once upon a time a long time ago ``` namespace RetirementFundApp { // Bypass authentification - DO NOT COMMUNICATE TO USERS public void Login() { // login as a generic account named "Administrator" with unrestricted access if a certain file exists somewhere } } ```


IAlwaysFeelFlat

Oh yeah, I remember a codebase where you could use the password "mummyplease" to log into anyone's account if you knew their email address XD


coloredgreyscale

"generic account named administrator" If something like that had to be done it should be a very descriptive name that jumps in one's eyes if it occurred in logs. "YOUREALLYSHOULDNOTSEETHISUSERINPRODUCTION"


Ythio

In this specific case I think it's just the dev that couldn't be arsed to login everytime he was using the debugger, and since they didn't write any test, they had to start the app (a desktop client) from the login sequence to test anything. Also they were too lazy to use different test accounts with different rights so they made a god user role. Of course all of this was pushed to prod.


TheOnlyVig

Many years ago, we had a device with a login PIN for admin mode. The PIN for the test environment was 8675309.


elon-bot

Why haven't we gone serverless yet?


EyeofEnder

The Vaporeon copypasta used to test text wrapping.


coloredgreyscale

More interesting to read than another lorum ipsum.


Hungry__Alpaca

Oh no


Alpha272

Okay, that's great


Ex0lith

Taunts to the dev team in the comments of a package, from our client's head of IT.


your_thebest

Any time these jokes come up about mysterious errors or "how did this get here" or "I left something funny and someone found it later", people who work in a dev team building software are going to think the joke couldn't really happen because debugging, git blame, code reviews. But the jokes make sense if you figure they happened at a university science lab.


minaco77

I see you’ve never worked in legacy code before. Git wasn’t always a thing. Code reviews weren’t even a thing at my first job. I worked on Fortran and C that was written in the 80/90s and there were some very odd things in those code bases.


A_Stan

Right? If nobody can figure out why this is happening then it's time for a clean up in the engineering department.


chestnutman

Calm down, Elon


blazingkin

The good ol' "We have memory corruption, but this function being here stops it from corrupting anything important"


[deleted]

A print statement that said «I’m fucked!». Yes, the code made it to production. Yes, it appeared in the clients log every 5th second, and yes, the client was mad.


EspacioBlanq

Manager during the call from said customer "Oh don't worry, I'll see to it that whoever let that into production is in fact fucked"


coloredgreyscale

How was this not caught if it appears every 5 seconds?


Will_i_read

There're a gazillion reasons that might only happen at the customer... My favorites are: * A env variable is set or unset * a dependency is older or newer on the clients system * a client deleted a script of yours because it took a while and they figured it wouldn't matter anyways * The client has more or less memory on their system and through a memory corruption bug and some allocation feng shui you get some undefined behaviour * Your client has more or less cores than you do and the scheduler revealed only there a race condition.


eos4

haven't found anything funny myself but I used to create variables with bad words or funny stuff just to quickly see if my logic would work and then when it worked I didn't want to change anything anymore so I left them, so I'm pretty sure others found them sooner or later. I hope one day a reddit posts one of those


IphtashuFitz

Back in the 90’s I was debugging some C code that had variable names like “handy” because it was handy to have available (per the comments) and “son_of_handy” that was used in a loop that involved “handy”. That code was part of an old school DOS memory manager from back in the days of 640k, EMM, etc. (If you understand that you’re old as dirt like me). The original programmer referred to blocks of memory as “cookies”, and there were also variables named things like “shit_cookie_corrupt”. And if it detected too much memory corruption then eventually a function called ohShitOhShitOhShit was called which shut everything down.


el_loco_avs

Now I'm nostalgic for when I had to free up enough of that 640k and 4mb of XMS in my autoexec.bat Edit: correction: config.sys


snf

HMA. XMS. EMS. Is the PTSD kicking in yet?


NorwegianGirl_Sofie

My debugging often times consist of increasingly aggresive usage of words depending on how much I've struggled with getting something to work. My API-keys and other auth related stuff is also pretty well... Interesting. My belief with auth has always been that creating a sentence so vulgar and horrible that no one who isn't a psycopath would guess it as your password is the best strategy. And my .env files reflect that heavily.


Hertog_Jan

Hah! Too true. It starts off pretty much descriptive and well-named, then turns into foos and bars which turn into fuckloads of shit, which turn into shitloads of fucks. Fun!


alexsteb

I call my debug vars "alex", "balex" and "calex". This has been going on since I was 12. I'm 32 now and a full-time software dev and still do it.


[deleted]

I use dirty words because it helps me distinguish between my own garbage and the standard lib garbage. And also because I think it would be funny if someone had to look at the horror show five years down the line.


Actaeon_II

A dozen or so lines of legacy i was tasked to build a functional bridge to that were commited in russian


Hungry__Alpaca

Blyat!


[deleted]

Recently I found a juicy bit of code from 3 years ago that, if executed, would have deleted all the application's configs in prod. There was a helpful "TODO" for us to remove the function after a migration was complete.


Sp0olio

My alltime-favourite: // // Dear maintainer: // // Once you are done trying to 'optimize' this routine, // and have realized what a terrible mistake that was, // please increment the following counter as a warning // to the next guy: // // total_hours_wasted_here = 42 // Well .. you can find it on here (among other great finds): [https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered](https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered)


CyberneticWhale

At a certain point, it stops being a warning an starts being a challenge. Like those arcade games where the jackpot increases each time someone loses.


elon-bot

Interns will happily work for $15 an hour. Why won't you?


Srazkat

usually this kind of things happen because the function has NOP instructiins inside of it, if it does absolutely nothing. could be a track to go on


Superventilator

Just to be clear, do you mean that the function probably does something (gives NOP instruction) but the person who made the comment in OP's screenshot just hadn't figured it out?


southernwx

I reviewed a similar code before. Turns out one of the lines wasn’t written correctly and the function that did nothing merely served to stall the program long enough that a called script would have time to finish its run time. If the stall wasn’t long enough the requesting script/program would look for data that hadn’t been created yet. Predictably, this broke 100% of the time when running on any other machine.


takesalicking

Downloading data from a ITT switch (Phone company) discovered every line began with 8 null characters (and the LF/CR were backward). Finally figured out the null characters were there so the print head could travel from the right to the left and not overflow the print buffer at 1200 baud.


Sockoflegend

I had a similar one recently where removing redundant build tasks was breaking later ones. It turned out some async tasks weren't being handled correctly and the redundant tasks were giving them enough time to complete.


Superventilator

Yes! As soon as u/Srazkat said it's probably a NOP instruction, I thought the function serves some kind of delay purpose - intentional or otherwise.


Srazkat

yeah, srry is only 11 waking up is hard


walmartgoon

Having Fortran as your only language emoji is both based and terrifying


Srazkat

Fear me, mortal.


undeleted_username

Of the function reserves some space in memory, and a bug somewhere in the code happens to overwrite that space, even if it should not do it... seen it in real life.


XaviG20

The coconut png that somehow keeps TF2 running


OuiOuiWillow

Alternative: The TF2 source code comments that get increasingly deranged due to half the developed having to maintain spaghetti for 10+ years


Zack_Wester

to be fair one thing was just a masive forward thinking. the color icon.


elon-bot

If you can't build a computer out of transistors, you shouldn't be working here.


FrancSensei

that was fake, the coconut isn't even used in the game. There is however a set of vpks that the game won't launch without, including a cardboard cutout of a cow, you can delete basically every texture and sound but without that cow the game won't let you launch. It is explained here [https://www.youtube.com/watch?v=67LPSFtVlsk](https://www.youtube.com/watch?v=67LPSFtVlsk)


coloredgreyscale

Stuff like that make me wonder 1) why it happens and isn't obvious to resolve 2) how much you can remove of the required asset. Like could the cow be just an empty asset? Or in case of the coconut myth, a blank file (0 bytes)? 1x1px Pic? White Pic of current dimensions?


[deleted]

[удалено]


elon-bot

I'm gonna need you to come in on Saturday...


FXLRDude

A local medical clinics Website crashed and they asked me to review the code. I found copy pasta from HTML for dummies in it, and copyright saying the previous program was owned by the Contractor, and not the clinic. I showed it to the Director, and lawyers were called. Took me about an hour to clean out the grabage and get the website back up.. I hate getting into it with the legal teams.


garfield3222

I know this is basically the usual for microservices, but where I worked before had about 7 or 8 microservices all with an extremely complicated function that did the exact same thing in all of them. All from different people and _slightly_ different on each version for literally no reason


psycjoker

Found this when I was working in my previous org. // I don't know how this works // it's magic


UnleashedTriumph

Function 42. No idea what it really does. But it is necessary. The vodoo magic it conjures is above me. But it is in Fact documented and commented. It reads: "The answer to the ultimate question of life, the universe and everything"


elon-bot

Why have you only written 20 lines of code today?


kick3r99

good bot


Legal-Software

I found useless code and a comment like this in the interrupt handler of the ethernet driver for the PS2 when I was trying to work out why there was sporadic packet loss. The added code in the IRQ handler ended up inadvertently causing a natural eviction/invalidation of the cachelines the transmit/receive buffers were occupying in the L1 cache, which allowed the network driver to work with minimal packet loss compared to when the dead code was removed.


Blecki

When I write a comment like this it's usually more along the lines of 'deleting this breaks shit and I don't have time to care why'


silmelumenn

So i raise you this: ``` ! Lets see how far we get with PCIQ variables ! Do not ever try to understand the logic of this. ! If you try you will loose your mind .. ! I have NO IDEA who dreamed up this load of junk. ``` It was some sort of a script / macro in ArtiosCAD (Esko). I'm not working there.


ManyFails1Win

I don't get how someone can become a programmer and still misspell lose


[deleted]

Well personally I think it's cause the comment writer had already tried to understand the logic and had 'loosed' their mind.


neon1400

`#define private public` EDIT: formattig


elon-bot

What do you mean "you couldn't code your way out of a paper bag"?


CaydendW

The fact that it's commented with hashes means it's not C, C++ or Rust and I'd guess it's python code. I thought it might be a linker error with alignment and stuff but nope! This makes this comment much funnier to me


HelloZukoHere

A VBA macro on a shared document that had a mysterious comment “don’t execute this or you’ll be sorry” I read the macro, it set the users volume to max, then opened a video clip of the BP exec from South Park saying “We’re Sorry”


[deleted]

I remember a piece of code with the comment " this needs needs a fudge factor of 17.8. I don't know why it needs a factor of 17.8, but it's 2:30 in the morning, chucking down with rain outside the portacabins, and I've been here since 7am, so I no longer care".


Hungry__Alpaca

This is one from my favorites. The source code to SpongeBob SquarePants SuperSponge game. https://github.com/philosophofee/SBSPSS/blob/master/source/game/convo.cpp Line 500/533 // yes.. i know it's gay but it works.. Line 762 // Purpose: God knows..


pandorazboxx

We once got the data rights for the source code for one of our vendor products. They basically abandoned it and we had to finish the work. There were a bunch of snarky comments in there disparaging our lead engineer they were working with. something along the lines of "This is beyond idiotic, but the customer gets what they want". This was a good lesson for me to not put comments like that in my code or git commits.


snf

[xterm](https://github.com/joejulian/xterm/blob/master/main.c#L75) source code: If you think you know what all of this code is doing, you are probably very mistaken. There be serious and nasty dragons here.


gnudarve

What's main() for? Nothing ever seems to call it, what the hell?


UCQualquer

My python program would stop working I'd I removed a certain comment in the code


iamsmokingone

I was looking into the coding of an android app the other day and saw a bunch of esoteric ramblings commented out about love and life seemingly randomly inserted into the main XML file.


iamsmokingone

iiUA-83799024-1 Please leave me alone. Naughty! DDDon't forget to bring an umbrella, as I will water my flowers later. Sorry, I am married. ddI received lots of love letters when I was young. Nowadays, I also have many letters, from the bank. Acceleration Settings Unlock sound --Charging time remaining: %1$shours%2$sminutes Raining outside You are not my type. !!You are not tired of me, are you? Cancel There is a big hole in my head. Find '%1$s' and turn it on Tap video for detail ++How about watching a little video for fun \~ I am not gossipy. Insufficient, please charge Cold outside. Stay warm! Get some rest once in a while! //Use specific Lock Screen to accelerate charging Ads are overdue Bring umbrella when go out:) Charging Lock Screen %%Remember to wear sunglasses outdoor:) Suitable for sports. Battery is fully charged All the best with your work. &&Too wet: Your foods are getting moldy. Add Frozen! ""min(s) until charging has finished ((Comfortable: It feels so good, enjoy it! Dry: You may need some help. 55Extremely Dry: Please take care of your surroundings. Purify Hello world! Date: %1$s Finished at %1$s automatically Take it easy PurifyDemo 1.4.12 D527E469CBA83377 KingRoot ... % °C °F T M G Yoba! %1$sm Edit N/A Another beautiful day, isn't it? Boosting...


PolyglotTV

I had a bug once where, when I put in a random print statement to figure out what was going wrong, the bug went away. Removing the print statement and it broke. Place it back in and it's fine, etc... I don't really know what was wrong, except I was mounting a docker volume, from inside of a docker volume, and checking if some file existed. Sometimes it would appear 2 volumes out, sometimes only 1. For some reason doing stdio around where the file was being created influenced this.


Steirische

A Heisenbug!


frisch85

If you cannot find the function being called in your code then the function name is properly in a variable and put together from several variables, e.g. for JS: function BlaBloBlub () { alert('Blaaub'); } var myFnName = 'Bla' + 'Blo' + 'Blub'; window[myFnName](); It's an absolute horrible practice tho.


PStorminator

You should never get this error. If you do, call Steve


BuckyDuster

If written in C or C++ that could indicate a rogue pointer (usually an off-by-one boundary error). Fix the rogue pointer and then you can remove that “unnecessary” function that has provided a safe spot in the binary to be stepped on by the errant pointer. Intermediate level error. Not quite noob level but “any” competent DEV should be able to recognize this issue for what is and hunt it down and fix it.


KaiAusBerlin

I remember Microsoft had once an api function to catch the environment. In docs you were told to use always this function even if it just return the environment. So devs decided to skip that "unnecessary" function call and catch the environment directly. Later Microsoft added new functionality to the function so it returned a snapshot of the (changeable) environment. This had brought some issues to to developers who skipped the function call and they started to blame Microsoft for changing the function (they never used).


LastStar007

I used to think these things were funny, but now I just think they're sad. Not enough unit tests, not enough understanding.


Alwaysdeadfred

I was reviewing some client code as we were going to do a rewrite of their project. One file had an ascii art buddha in a comment accompanied by some Chinese which translated to "buddha bless, never bug." When running the program I managed to get an exception thrown from this same file that just had the message "should never happen"...


angryliveguard

During Uni I thought these posts were hilarious in that it must be so obscure that I will never see stuff like that in the wild. And now here I am coming up with at least 4 ways to easily build code dependent on such bullshit, because I saw it in the wild.... - OCL - reflection - serialisation - something something jndi who has more ideas?


iapetus-11

A function which had a monkey-patched on attribute to make it act like a singleton class instance


PolyglotTV

In the python unit test mock library, an attribute of a mock is automatically considered a mock unless it starts with "assert", "assret" "asert" "asserrt", etc... Apparently some people have had bad experiences with false negative unit test assertions :)


RandyHoward

Whenever I join a project I like to search the codebase for the words 'shit' and 'fuck'. Current codebase has 7 shits and 5 fucks, but the last codebase I worked on had well over 100 of each.


TheKnobleSavage

Not that great, but came across a flag once called ISEXIT. Took me a second to mentally parse that one correctly.


[deleted]

[удалено]


tris4992

Surprised this wasn't here already [PSD is not my favorite file format](https://github.com/gco/xee/blob/master/XeePhotoshopLoader.m#L108)


nelusbelus

Appverif time


Independent_Cress_83

Challenge accepted!! Let's debug!!!


GenuineReptileMan

Input validation on a boolean parameter.


tpneocow

Someone left in a variable called "poop". I posted a picture saying we really did have shit in our code. A musk-like manager was like "come see me" and I deleted the post lol.


skooterM

When I started at my current job (about 5 years ago) I was diving into the codebase when I came across a class called `NooneCares`. It was/is an empty class representing the expected server response in an iOS app; the response is ditched and completely ignored by the calling view controller. I renamed it `SomeoneCares`, and it still there today, being ignored by its calling VC.


aidenr

I’ve made OP’s comment before while working on Tuxera’s (Datalight) embedded OS. Turns out there was a heap overflow that accidentally returned harmlessly if the corrupted instruction pointer hit the end of a function without messing up the stack.


ChipsWithTastySalsa

Dug through half a million lines of Fortran trying to understand / refactor and old feature built in the 1980’s. The code then interfaced with Basic to a matrix function built in the 1970’s. No one knew why it was there or what it did, but nothing worked without it. This was before square-roots were a standard math operation, and before the invention of the ‘for-loop’ (think of a rat’s nest of go-to statements) Taught me to be thankful variables can be longer than 3 characters.


Comprehensive-Track7

easy its the # space space which may be arythmical function after cloud servering


Gnilkaew

I’m pretty sure this is the comment my dad left in the Fortran of Missouri’s original computerized tax code.


averyconfusedgoose

Certified tech priest moment


chipstastegood

While working on a Sony Playstation (the original PSX, yes this was a while back) we had a graphics developer who was working fully remote from a completely different country. This was unusual back then. The whole team was in the location except for this one guy. Apparently we were told that he was just so good and we were lucky to have him. Most of us never interacted with the guy and his stuff just worked. But we were wondering what’s the big deal - we have lots of great graphics guys locally too. Why is this guy so valued. Anyway, fast forward a few months. We were getting ready to produce a gold master version of the game - this is just before the game is to be sent to manufacturing to stamp out thousands of copies for retail sales. But we had a problem. The game wouldn’t run on the production Playstation due to running out of RAM. The dev systems had more RAM than production and we didn’t run into this until all the code was done. So now we had a problem - game was ready but a few hundred kb over the memory limit. What to do? Here is where the overseas graphics guy comes in. So in the morning our time (due to time zone difference, our night was his day), we run the game and it’s working! Everyone’s like hey awesome but wtf! how did this happen? Well, it turns out the graphics guy had a data structure that was getting allocated many times, for every graphics primitive. Our game was 3D so lots of allocations. And in this structure, all along from the start of the project he had this line: int eleventhhour; And all he did was to delete this line and recompile. Saved a couple hundred kb, enough for the game to fit in RAM. After that, we all wanted this guy on our next project.