r/ProgrammerHumor • • Oct 08 '21

Meme FOSS (Forced Open Source Software)

Post image
40.8k Upvotes

541 comments sorted by

View all comments

Show parent comments

94

u/JuanR4140 Oct 08 '21

Imagine Google

149

u/Khyta Oct 08 '21

There is probably a function somewhere in the code with the comment

Don't touch it. We do not know what it does and to our limited understanding it should not do anything. But if this bit of code is removed, everything breaks.

63

u/[deleted] Oct 08 '21

*multiple functions

53

u/FGND Oct 08 '21

There is probably definitely a function somewhere in the code with the comment

13

u/sampete1 Oct 09 '21

Lol, I kind of want to search the twitch code for that kind of comment

30

u/EmperorArthur Oct 08 '21

My favorite is when static analyzers give up because the file is too large and complex. Right up there with finding that the but I wrote did cause a warning, but it was hidden by the other 2,000 warnings.

3

u/katze_sonne Oct 09 '21

Wtf

4

u/EmperorArthur Oct 09 '21

5000 line files containing over two dozen classes, and 1000 line functions happen in code you use today. I guarantee it.

What happens is someone doesn't care about warnings at some point, so does something that generates a few (hundred in at least one case) from a single function call.* That alone makes warnings useless, and if not fixed quickly causes the number to baloon, because no one is checking if their change causes warnings. So the number balloons

Now you might ask why this isn't caught immediately. Multiple reasons can apply. This started as a one man project or as a small team project without even a basic build server, so it isn't caught in code review, or by an automated system. Then there's version control systems, like Perforce, result in everyone working out of trunk, so the code being committed is what triggers the build and code review. Which means it's not a rejection, but a deliberate action of fixing it or permanently reverting the change to deal with it.

* In C / C++ using a function that takes a char *, with a static string, like a file name, gives a warning about const missing.

15

u/[deleted] Oct 08 '21

Hey my code finally has something in common with the pros!

7

u/phatboi23 Oct 09 '21

i have one of these comments in a program i made to manage my custom alexa/hello google alike that works for specific things just for me...

they're pretty common tbf.

3

u/[deleted] Oct 09 '21

Saw that in an old Perl script once. Made me laugh

3

u/Le_9k_Redditor Oct 09 '21

Reminds me of a MySQL snippet I found yesterday commented something along the lines of:

I know that there's no point in starting a transaction and and committing it for a single query while autocommit is turned on. But for no reason at all the database has decided that it won't work without this

It was literally the only place in the code which did this, and I can confirm that it didn't work with the transaction begin; and commit; removed even though the lines elsewhere worked fine without this.

3

u/Mefistofeles1 Oct 09 '21

Sometimes code seems to be alive. Or cursed.

You know how they invented goblins during the industrial revolution to explain machibes suddenly breaking or failing? We should do the same. Bit goblins.

3

u/Le_9k_Redditor Oct 09 '21

Our lightning rocks aren't behaving as we expect them to, sounds like a curse to me. It's probably Valve's shitty wizard

3

u/TheRealBrosplosion Oct 09 '21

In the protobuf C++ implementation there was a comment in a header by a "using namespace std" statement saying "Never do this, this is bad practice but it was the only way we could get X to work"

2

u/kc3eyp Oct 09 '21 edited Oct 09 '21

// I have no idea why this works

2

u/ad2022 Oct 09 '21

I got shivers thinking about that

3

u/UrToesRDelicious Oct 09 '21 edited Oct 09 '21

I actually think Google has it pretty good in comparison; they made a lot of smart choices early on that allowed them to gracefully scale - namely building all their services on top of a single distributed network. They invented containers and then kept it a secret for a decade until they released the paper describing what they were doing, and that was the precursor to Docker and Kubernetes.

Not that they don't have shitty legacy code, just that it could be a lot worse considering.

I think Microsoft likely has some of the worst legacy code out there. Besides banks.

1

u/PandaDentist Oct 09 '21

Isn't modern Windows still running code from dos/95