this post was submitted on 13 Dec 2025
648 points (97.6% liked)

Programmer Humor

28009 readers
1167 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Grandwolf319@sh.itjust.works 27 points 1 week ago* (last edited 1 week ago) (3 children)

How about

x=x-x

x++

x++

x++

x++

x++

x++

x++

x++

x++

x++

[–] okmko@lemmy.world 8 points 1 week ago* (last edited 1 week ago)

Freshman year of college doing assembly programming, I spent a while figuring out a "programmic" way to solve a problem, trying to wrangle labels and gotos. My friend came in with essentially this but as lookup table. It blew my mind.

It was then that I learned to trade space for complexity.

[–] xthexder@l.sw0.com 7 points 1 week ago (1 children)

This is actually a valid brainf*ck program, but it results in 19, not 10.

[–] Grandwolf319@sh.itjust.works 6 points 1 week ago (2 children)

How so? It’s only 10 increments

[–] anton@lemmy.blahaj.zone 5 points 1 week ago

Because the only brainfuck instructions in your comment where a - which decrements and 20 +, each of which increments.
Mine echos the first two characters from stdin, because of the commas and dots.

[–] juliebean@lemmy.zip 2 points 1 week ago

it's been a long time since i looked at brainfuck, but i suspect that '+' denotes an increment, and '-' denotes a decrement, so we've got one decrement and 20 increments.

[–] olenkoVD@lemmy.dbzer0.com 1 points 1 week ago (1 children)

Make sure you initialize x with x=x/x-x/x for better precision

[–] Grandwolf319@sh.itjust.works 1 points 1 week ago (1 children)
[–] brotundspiele@sh.itjust.works 1 points 6 days ago

Just add // @TODO find out why this crashes our application sometimes to fix that issue