this post was submitted on 15 Jun 2023
77 points (100.0% liked)

Programmer Humor

32078 readers
651 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 18 comments
sorted by: hot top controversial new old
[–] johnhansarick@kbin.social 12 points 1 year ago (4 children)

Reminds me when I was working with a guy and he named a database table recieved . I had adapted my code to that, and then one day without warning he renamed it to received - and it took us an hour to figure out why everything broke.

[–] gbhorwood@kbin.social 3 points 1 year ago (3 children)

had a co-worker once who called the variable holding the first record in a complicated workflow "rec1st" and the last record "reclst", unaware that in every font used by every code editor except his, a lowercase l and number 1 look identical.

i spent a day debugging that after he quit.

[–] kartonrealista@lemmy.world 5 points 1 year ago

Lesson for the future: stop using crappy illegible fonts in a code editor, and use something nice like Fira Code or even Fira Mono or Sans if you don't like ligatures.

Edit: In the middle of writing this I realized it was a confusion between "1" and "l", which makes the font choice even more bizarre. What kinda garbage font doesn't distinguish between the two? I could understand if it was capital "i" and lowercase "l" since they look extremely similar in most sans serif fonts, but "1" and "l"?

Also it takes like 10 seconds to change the name of a variable across the whole file with a modern code editor like VSCode or an IDE for the specific language you were working with. If they were confusing you, you could have just changed "reclst" into "last_record" and that would save you a day of work.

[–] Bankenstein@feddit.de 3 points 1 year ago* (last edited 1 year ago)

No good code font would make 1 and l look identical. Character differentiability is like the most important thing.

Look, JetBrains did it right.

[–] japps13@beehaw.org 1 points 1 year ago

Maybe he wasn’t really unaware that only his font choice differentiated the names.

[–] Black616Angel@feddit.de 2 points 1 year ago

Our Python virtual environments at work on all Linux-servers are in the directory /opt/vens instead of /opt/venvs so when some intern corrects that, we will be screwed!

[–] Thaidakar@kbin.social 2 points 1 year ago

I've had the misfortune to work with a database containing both spellings across various tables. Some tables would have both in different columns

[–] freundTech@feddit.de 1 points 1 year ago

This reminds me of the HTTP referer header, which started as a misspelling of referrer, but because everyone just went with it is now part of the standard.

[–] hannes3120@feddit.de 10 points 1 year ago (1 children)

Excel wrongly assuming the year 1900 was a leap year for their timestamps is my favorite bug that will never be fixed because everyone has built workarounds for this already

[–] tjhart85@kbin.social 5 points 1 year ago (1 children)

Didn't they do that intentionally to be compatible with Lotus 123?

[–] Bankenstein@feddit.de 4 points 1 year ago (1 children)
[–] tjhart85@kbin.social 1 points 1 year ago

Thanks for backing me up :-)

A link from MS as well, backing us up :-)

[–] PiedPipetter@kbin.social 7 points 1 year ago (1 children)

I wrote code for industrial automation years ago (think assembly line machines). I was reviewing production code and found a stupid bug and fixed it, then reinstalled. The motors moved incorrectly - I don't recall if that was the time it smashed glass everywhere, but "fixing" the code definitely broke the program. I could not figure out why...but due to time constraints I sadly had reinsert the bug to put the machine back in production.

Some nights that still bothers me.

[–] tal@kbin.social 4 points 1 year ago* (last edited 1 year ago)

https://en.wikiquote.org/wiki/Donald_Knuth

Beware of bugs in the above code; I have only proved it correct, not tried it.

Donald Knuth's webpage states the line was used to end a memo entitled Notes on the van Emde Boas construction of priority deques: An instructive use of recursion (1977)

[–] db0@lemmy.dbzer0.com 6 points 1 year ago

The fact that they mention using EMACS makes it even funnier

[–] mcmxci@lemmy.one 2 points 1 year ago* (last edited 1 year ago) (1 children)

There are a bunch of comments in this thread on kbin.social at https://kbin.social/m/programmerhumor@lemmy.ml/t/26213/XKCD-1172 but none here at lemmy.one. Every time I think I understand federation I get thrown for a loop

[–] supersheep@lemmy.one 1 points 1 year ago* (last edited 1 year ago)

Hmm, I’m also registered at lemmy.one and having the same problem. Really curious on how I can make sure all the comments are shown or how this works. Maybe the instances still have to sync or something?

[–] lowleveldata@programming.dev 2 points 1 year ago

Global warming must be fun for this guy

load more comments
view more: next ›