this post was submitted on 09 May 2025
458 points (100.0% liked)

Programmer Humor

23996 readers
1390 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
top 31 comments
sorted by: hot top controversial new old
[–] [email protected] 56 points 1 month ago (2 children)

Oooh, that is tempting. The main pain would be center justifying the code. Perhaps if it was left justified...

[–] [email protected] 44 points 1 month ago (1 children)

Clearly we need self-centering support from editors.

[–] [email protected] 25 points 1 month ago (1 children)

Just one more reason to do your coding in Word.

[–] [email protected] 3 points 1 month ago

Technically that is a reason

[–] [email protected] 7 points 1 month ago

I think the main pain would be manually aligning the frames on every line with every change, occasionally having to extend the width and updating every line of code to match it

[–] [email protected] 28 points 1 month ago (2 children)

My employer's CI rejects extended ASCII characters :(

[–] [email protected] 7 points 1 month ago* (last edited 1 month ago) (2 children)

Really? You never use the occasional   or something?

Edit: my client actually parses the space lol

[–] [email protected] 3 points 1 month ago

Just remembered not all projects have a web interface or an interface at all

[–] [email protected] 1 points 1 month ago

Backslashes are not extended ASCII

[–] [email protected] 3 points 1 month ago (1 children)

That's normal, you should just use Unicode in that case.

[–] [email protected] 5 points 1 month ago (1 children)
[–] [email protected] 1 points 1 month ago (1 children)

Feel free to encode it whichever way suits you best.

[–] [email protected] 2 points 1 month ago (1 children)

Unless it's ISO 8859-1, apparently.

[–] [email protected] 1 points 1 month ago (1 children)

I'm not sure if you're completely up to date on this whole Unicode thing.

[–] [email protected] 3 points 1 month ago

I'm not sure if you're completely up-to-date on this whole encoding thing.

[–] [email protected] 20 points 1 month ago (1 children)

This only half as bad as the emoji soup macros

[–] [email protected] 1 points 1 month ago (1 children)
[–] [email protected] 8 points 1 month ago (1 children)

I got something better for you.

namespace 🔵 = std;
using 🔢 = int;
using 💀 = void;
using 🕖 = time_t;
using 👌 = bool;
#define 👂 auto
#define 🎌 enum
#define 👎 false
#define 👍 true
#define 👹 "evil"
#define 💪 🔵::make_shared
#define 🍸 virtual
#define 🖥️ 🔵::cout
#define 🔫 🔵::endl
template<class 🔮>
using 📚 = 🔵::vector<🔮>;
template<class 🔮>
using 👇 = 🔵::shared_ptr<🔮>;

🎌 🐒 { 🐵, 🙈, 🙉, 🙊 };
🔢 🎲() { return 🔵::rand(); }
👌 😎() { return 👎; }

struct 🍴 { 🍸 💀 👀() = 0; };
struct 🍊 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍊" << 🔫; }; };
struct 🍉 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍉" << 🔫; }; };
struct 🍒 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍉" << 🔫; }; };
struct 🍓 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍓" << 🔫; }; };
struct 🍍 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍍" << 🔫; }; };
struct 🍅 : 🍴 { 🍸 💀 👀() { 🖥️ << "🍅" << 🔫; }; };

🔢 main()
{
    if(😎() == 👎)
        🖥️ << "💩" << 🔫;

    📚<👇<🍴>> 🍛 = { 💪<🍊>(), 💪<🍉>(), 💪<🍒>(), 💪<🍍>(), 💪<🍅>() };
 
    for (👂 🍏 : 🍛)
        🍏->👀();

    return 🎲();
}
[–] [email protected] 1 points 1 month ago
[–] [email protected] 12 points 1 month ago

Remember the meme where all the parentheses are on the right hand side? This meme is the same.

[–] [email protected] 9 points 1 month ago (1 children)

super minor but I always preferred to define fizzbuzz as modulo 3*5 to show adherence to the instructions in the readability of the code without having to think about why

[–] [email protected] 5 points 1 month ago

Mmm I think they are missing == 0

[–] [email protected] 9 points 1 month ago

This would musk to write, but is honestly really readable.

[–] [email protected] 8 points 1 month ago* (last edited 1 month ago)

You could do this in basic ASCII, with only three defines. replace "_ " with "{", replace "_;" with "}", and "_" with nothing. If your compiler processes macros in the correct order, it will become valid code. (You would use semicolons as the vertical lines)

[–] [email protected] 4 points 1 month ago (2 children)

Have they #defined out the equals symbol? I don't think that for loop is going to compile.

[–] [email protected] 24 points 1 month ago

The symbol they defined out is not the equals symbol but rather U+2550, so the for loop is fine.

[–] [email protected] 3 points 1 month ago (1 children)
[–] [email protected] 1 points 1 month ago (2 children)

The #define = line would mean the = would be effectively removed, rendering the for a syntax error. That is, assuming it is an equals sign they've redefined, and not similar looking character.

[–] [email protected] 15 points 1 month ago* (last edited 1 month ago) (1 children)

that's not a =, it's a ═ (U+2550 BOX DRAWINGS DOUBLE HORIZONTAL). you can tell because == doesn't connect but ══ does.

[–] [email protected] 3 points 1 month ago

Fair point, I wasn't sure it was the equals, hence my initial question. Drawing boxes with the box drawing characters does make a lot more sense.

[–] [email protected] 1 points 1 month ago

It looks like a different symbol of you were to compare the characters length in pixels

the equals and the horizontal double bars seem different to me.