this post was submitted on 17 Jun 2023
29 points (100.0% liked)

Programmer Humor

24957 readers
2039 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 16 comments
sorted by: hot top controversial new old
[–] drew_belloc@programming.dev 2 points 2 years ago

Amateur! I use coments so it looks like this:

function main(){ /tab/if(fish==2){ /tab//tab/console.log("i need help"); /tab/} }

[–] lasagna@programming.dev 1 points 2 years ago* (last edited 2 years ago) (1 children)

3 spaces is best because if the universe is chaos then everything in it should reflect that.

[–] soundasleep@kbin.social 3 points 2 years ago

I'm more about increasing spaces exponentially to really highlight how important each line is

public boolean function() {
 if (method()) {
   if (otherMethod()) {
       for (Object o : list()) {
               if (o.isAlive()) {
                               return false;
               }
       }
   }
 }
 return true;
}

[–] PitzNR@lemmy.world 1 points 2 years ago (1 children)

This is horrifying, this is straight up blaspheny

[–] chaorace@lemmy.sdf.org 0 points 2 years ago (2 children)

For real. OP needs to give up on this ridiculous notion of tabbed whitespace and learn to use real, monospaced indentation. How wide is a tab? OP couldn't tell you because tabs are inherently dishonest -- a lie concocted by big keyboard to poison the unwashed programmer masses.

[–] gnuswann@programming.dev 1 points 2 years ago

I meant for my personal projects. For the code that only I see, tabs are much better for navigation. But it's true that if there are several of us working on the project, the spaces are much better.

[–] xyon@lemmy.blahaj.zone 1 points 2 years ago (1 children)

Tabs are one tab character wide, it's perfect

[–] chaorace@lemmy.sdf.org 1 points 2 years ago

You're one character wide

[–] thkruz@programming.dev 0 points 2 years ago (1 children)

...this...this can't be real...no one is that much of a sadist are they?

This whole thread is what nightmares are made of.

[–] deaf_fish@lemm.ee 2 points 2 years ago

So at my work we've implemented a automatic code formatter. Instead of having discussions about the process of changing the configuration file we just put it up on GitHub. I think I might have found a fun April fool's prank.

[–] ZILtoid1991@kbin.social 0 points 2 years ago (2 children)
int mostCursedIndentation (const int someVal) @safe {
{}{}if (someVal < 0) {
{}{}{}{}throw new Exception ("Value cannot be negative!");
{}{}}
{}{}return someVal * 5 - 3;
}

[–] vvv@kbin.social 1 points 2 years ago (1 children)

i dont wanna talk about the lua version of this

local function someFunction(arg)
do end local SomeLocal = 40;
do end if arg > SomeLocal then
do end do end SomeLocal = Somelocal + arg
do end elseif arg < SomeLocal then
do end do end arg = arg * 2
do end do end if SomeLocal > arg then
do end do end do end error("oh my god why are you trying to read this")
do end do end end
do end end
do end return SomeLocal
end

someFunction(-0.3000000000000124976137894613978561389741642978623178913786926473891)

[–] cloaker@kbin.social 0 points 2 years ago (1 children)
[–] nevemsenki@kbin.social 1 points 2 years ago

He has already left the chat

[–] soft_frog@kbin.social 1 points 2 years ago (1 children)

Can you start randomly nest them too?

{{}}{}int foo = bar

[–] ZILtoid1991@kbin.social 1 points 2 years ago

You made it even worse!

load more comments
view more: next ›