Ikinokore! Shachiku-chan - Vol. 1 Ch. 5 - The story of the Colleague

Double-page supporter
Joined
Mar 4, 2018
Messages
602
I can confirm that putting the opening curly brace on a line of its own is base heresy. Heretics get tied to a server rack with ethernet cables and burned on a pile of programming manuals.
 
Dex-chan lover
Joined
Apr 15, 2018
Messages
2,867
There are 2 types of people, one is the person who puts curly brace down a line, the other is belong to the cross.
 
Member
Joined
Jun 26, 2018
Messages
30
Well I've seen people who write like this:
Code:
if(foo)
<tab>{
<tab>bar();
<tab>}

But on another note. Tabs or spaces? @Anomander @ngkn92

Edit: Yeah idk how to make spaces...
 
Double-page supporter
Joined
Mar 4, 2018
Messages
602
@ZnV0YQ Tabs of course. In fact I've set my editor to convert spaces to tabs since some lowlife no-goods use spaces. This can prompt interesting discussions when there's a merge conflict on git and someone tries to figure what's changed with a diff tool. (Well to be fair our coding standards guide says to use tabs, but it can happen that sometimes someone forgets, or we're working on old code back from less rigorous days.)
 
Double-page supporter
Joined
Sep 22, 2018
Messages
942
I've only ever written small scripts so i always formatted it like this -

if

[(long string) + (of) + (multiple things)]

do

{

(x)

(y)

{

if

(y)

=

(null)

do

(something)

(0)

(1)

}

}

tldr; i have SOOO much whitespace that if i made a typo i can find the thing almost immediately. only 1 space over as-well so if someone found my code they prob wouldn't have any formating issues there, the problem would most likely be my stuff is color coded by notepad++ meaning i cant just hover over a } or { and it'l color its counterpart as-well, so figuring out which } matches { would be a pain to them if not using a program with that feature. otherwise i don't see how an issue could occur with it since excess lines don't cause lag due to me running it through a website that deletes all the whitespace when i want to implement it.

tldrttldr; IFYOUEVERSAWMYCODEITDPROBLOOKASBADASTHISSENTENCEDUETOREMOVINGMYFORMATTINGSOTECHNICALYIGUESSICOULDHAVEJUSTCOMMENTED"PROBLEMSWITHANOTHER'SFORMATTING?LOLITSPROBMORELEGIBLETHANWHATYOUDBEABLETOSQUEEZEFROMMEXD!"ORSOMETHINGALONGTHOSELINES...OWELL!
 
Aggregator gang
Joined
Oct 9, 2018
Messages
258
I use both styles. Curly bracket on the next line for C#; curly bracket on the same line for JavaScript, C, Java, and any other language for which I code in an IDE that doesn't auto-format stuff. I am the DeProgrammer.
 
Dex-chan lover
Joined
Mar 5, 2019
Messages
4,489
I not understand coding...

Even Roblox Lua seems convoluted when all I wanted to do was make a working gun model...
 
Dex-chan lover
Joined
Dec 20, 2018
Messages
4,010
Automation is your friend. It means you get hours over to do other stuff.

And telling your boss about it is probably unwise. Sometimes they might give you more work, but they might just as well cut your hours (and salary) for having done a good job.
 
Aggregator gang
Joined
Apr 4, 2019
Messages
263
It is definitely
If (condition){

}
Especially when it’s just the preset conditions like checking for NULL or breaking a loop then personally I do
If (condition){return/break}
 

Users who are viewing this thread

Top