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.
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.
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)
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.
Oh, that's weird. Kinda not that bad- ... wait, where are the semi..co...lon..s... What? OH NO!! What the fuck! Hahahah, that's awful. There's some real bad stuff in this thread, but that first one is deceptively awful. Whew.
Note that this is much better for code style because - as opposed to the semicolon indentation- the single statement if and else branches still work. The trailing else is on the same line on purpose, it's so small it doesn't need its own line.
Here's another style with similar properties:
37 Comments
drew_belloc@programming.dev · 38 pts · 3y
Amateur! I use coments so it looks like this:
function main(){ /tab/if(fish==2){ /tab//tab/console.log("i need help"); /tab/} }
PitzNR@lemmy.world · 12 pts · 3y
I want to downvote you so, so bad, so take an upvote and leave.
gnuswann@programming.dev · 3 pts · 3y
Him: I spend 3months on this project Me: how many lines does it takes now? Him: I would say around one line of code
lasagna@programming.dev · 17 pts · 3y
3 spaces is best because if the universe is chaos then everything in it should reflect that.
soundasleep@kbin.social · 23 pts · 3y
I'm more about increasing spaces exponentially to really highlight how important each line is
lasagna@programming.dev · 5 pts · 3y
Good, good. The less consistency the better.
zbyte64@lemmy.blahaj.zone · 2 pts · 3y
Use the Fibonacci series so you can smugly claim your code incorporates the gold ratio
WalrusDragonOnABike@kbin.social · 5 pts · 3y
But what if the chaos plays favorites and favors tabs?
lasagna@programming.dev · 3 pts · 3y
For line in lines: if char[0] == SPACE { del char[0]} else if char[0] == TAB {char[0] = SPACE*3}
save('overwrite')
PitzNR@lemmy.world · 16 pts · 3y
This is horrifying, this is straight up blaspheny
chaorace@lemmy.sdf.org · 8 pts · 3y
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.
xyon@lemmy.blahaj.zone · 8 pts · 3y
Tabs are one tab character wide, it's perfect
chaorace@lemmy.sdf.org · 2 pts · 3y
You're one character wide
PitzNR@lemmy.world · 4 pts · 3y
The big keyboard played us for an absolute fools!
gnuswann@programming.dev · 3 pts · 3y
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.
saddestpanda@lemmy.one · 1 pts · 3y
How wide is a tab? Who cares? I'm not pressing more buttons just to make you feel better.
ZILtoid1991@kbin.social · 15 pts · 3y
vvv@kbin.social · 19 pts · 3y
i dont wanna talk about the lua version of this
cloaker@kbin.social · 5 pts · 3y
Jesus Christ
nevemsenki@kbin.social · 5 pts · 3y
He has already left the chat
gnuswann@programming.dev · 5 pts · 3y
This is the worst
soft_frog@kbin.social · 4 pts · 3y
Can you start randomly nest them too?
{{}}{}int foo = barZILtoid1991@kbin.social · 3 pts · 3y
You made it even worse!
jcg@halubilo.social · 1 pts · 3y
Highly readable
ndotb@programming.dev · 8 pts · 3y
I just want Coke to bring back Tab and Pepsi to introduce a competing drink called Space
thkruz@programming.dev · 7 pts · 3y
...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 · 7 pts · 3y
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.
z3n0x@feddit.de · 6 pts · 3y
After 15 semicolons you’re legally allowed to leave.
Bishma@readit.buzz · 5 pts · 3y
TIL you can turn any language into Brainf**k with the right .vimconfig.
Xanvial@lemmy.one · 5 pts · 3y
But why
jxk@sh.itjust.works · 3 pts · 3y
I know why it's there, but it still annoys me that there's a semicolon on the last line
Tempiz@sh.itjust.works · 3 pts · 3y
An absolute mad lad
lowleveldata@programming.dev · 2 pts · 3y
I use
Ctrl+Alt+Lfor indentionRiikkaTheIcePrincess@kbin.social · 1 pts · 3y
Oh, that's weird. Kinda not that bad- ... wait, where are the semi..co...lon..s... What? OH NO!! What the fuck! Hahahah, that's awful. There's some real bad stuff in this thread, but that first one is deceptively awful. Whew.
Really missing Haskell now :P
Speiser0@feddit.de · 1 pts · 3y
If people want me to write into my code what it does, I guess I'll label everything:
Note that this is much better for code style because - as opposed to the semicolon indentation- the single statement if and else branches still work. The trailing else is on the same line on purpose, it's so small it doesn't need its own line. Here's another style with similar properties: