[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

You know you're the spawn of Lucifer if...

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 80
Thread images: 11

File: Capture.jpg (12KB, 314x128px) Image search: [Google]
Capture.jpg
12KB, 314x128px
You know you're the spawn of Lucifer if...
>>
>>62195990
... you don't follow the code standards guides for your project, language or framework
>>
>>62196136
/thread
>>
>>62195990
>if (
eww
>>
>>62195990
>You know you're the spawn of Lucifer if...
You put all your braces 15 tab stops across.
>>
>>62196237
>if
>{
eww
>>
You know you're not a programmer who actually programs but a retarded g poster when the only topics you can contribute to are these retarded bikeshedding topics.
>>
>>62196136
fpbp
>>
>>62195990
I know this is bait, but for anyone who does this get a bunch of sequential if statements and fold the code.
condition
condition
condition

looks better than:
condition
{

condition
{

condition
{
>>
OTBS is love, 1TBS is life.
>>
if (
condition ){


}
>>
>>62199164
this
>>
>>62199164
>>62199183

i never hoped that much it's samefagging
>>
>>62199246
>>
>>62195990
You tell a compiler a way to construct a block statement?
I see this as an effective way to simply indentation and messy coding habits. May improve performance though I have yet to read that deep into Java.
>>
>>62199128
My man you are reminding me of Switch and case statements.
I guess switch and case statements are a way to promise it will do something compared to checking if a condition is met through the if.
>>
File: Memes.png (25KB, 931x392px) Image search: [Google]
Memes.png
25KB, 931x392px
>>62199246
Never have I knew that /g/tards try and guess the man behind the anon
Memes a hoe
>>
>>62199164
what the fuck
>>
>>62199352
if (condition ); int i == 0 || int j == i;[spoiler][/spoiler]
>>
func(array)
{
for(elem : array)
{
switch(elem)
{
case 1:
break;
}
}
}
>>
I prefer to go from maximum indentation level to left. That way you know when you're too deep.

            int main(void) {
for(int i = 0; i < 4; ++i) {
for (int j = 0; j < 4; ++j) {
for (int g = 0; g < 4; ++g) {
// oops looks like I need refactoring
}
}
}
>>
>>62199388
So you dislike formatting?
Best practices :(
>>
File: 7FsSTes.jpg (438KB, 1386x1385px) Image search: [Google]
7FsSTes.jpg
438KB, 1386x1385px
>>62195990

>conditional statements
>>
>>62199317
I dont know honestly. switch case statements have their place but sometime just stringing together 3 or 20 if statements looks better and does what you need just fine.
for example in a game if you are about to do an action on a player that works in most situations but in a few situations will crash your own game, its just better to string if statements to check their state, print a warning, and return back to the main menu.

Im sure someone will argue with me about it, but Im just speaking from my experience. the community I was in didn't really make use of switch statements all that much so I tend to completely forget about them.
>>
File: else.png (17KB, 125x125px) Image search: [Google]
else.png
17KB, 125x125px
>>
>>62199595
ideal
if (condition)
{

}
else
{

}


acceptable
if (condition) {

}
else {

}


abomination
if (condition) {

} else {

}
>>
If you don't use recommended auto-formatter with recommended style either by your project or by standard language guide before commit&push. Also nothing wrong with the picture.
>>
>>62199619
#2 is best

#1 is for noobs

#3 is for neat-freaks but it's actually less readable
>>
int function(int a)
{
if (a) {
return 1;
} else {
return 0;
}
}
>>
>>62199619
first one is always easiest to read and spacing is always consistent
>>
>>62199619
>I have never written anything else than an hello world application
>>
>>62195990
...you don't use the gnu style
...you use C instead of a proper language like Scheme or ML
...you use windows line ends
>>
>>62199992
>You dont use my stupid language that isn't any better than your language and isn't used by anyone
>>
Never write redundant line breaks or braces.
if (a) return 1; else if (b) if (c) return 2; else if (d) return 3; else return 0;
>>
>>62195990
>>62199164
if
(condition)
{ }
>>
>>62199992
You mean "use C instead of Rust"

>>62199619
Swap abomination and acceptable
>>
if (condition) {
# statements
} else {
# statements
}
>>
File: 1488813340442.jpg (308KB, 712x1134px) Image search: [Google]
1488813340442.jpg
308KB, 712x1134px
>>62199434
the thinking mans indentation
>>
>>62200170
Rust is cancer though.

>>62200019
>that isn't any better than your language and isn't used by anyone
Both false.
>>
>>62199619
if Condition then
Do_Shit;
else if Other_Condition then
Do_Other_Shit;
end if;
>>
>>62199992
Gnu style is absolute hell
Use a lisp if you want a lisp
>>
>>62200234
>Gnu style is absolute hell
No, it is the most cute and comfy.

>Use a lisp if you want a lisp
I do it anyway.
>>
>>62199674
int function(int a)
{
if (a) {
return 1;
}
else {
return 0;
}
}


Here, fixed that for you.
>>
>>62200263
int function(int a) {
if (a)
return 1;
else
return 0;
}
>>
>>62199674
>>62200263
>>62200293
All of these are about as satanic.
>>
>>62200263
int function(int a)
{
if (a)
{
return 1;} else
{
return 0;}
}
>>
>>62200329
int function (int a) {
if (a) return 1;
return 0;
}
>>
File: 1475515089656.png (709KB, 957x1518px) Image search: [Google]
1475515089656.png
709KB, 957x1518px
>>62200348
Literally you.
>>
>>62200387
https://vid.me/GGEUb
>>
(if (cond)
(block1)
(block2))
>>
Who needs if statements when you can do everything with the ternary statement? Then you're the spawn of Lucifer:

(condition) ? doSomething() : null;
>>
>>62200406
This site does not work with youtube-dl. Got another one?
>>
Egyptian brackets for everything in Java and JavaScript (Pajeets don't know or care that K&R style brackets in JavaScript can actually change the meaning of your code in edge cases).

Kernel style for C and C++: K&R for functions and Egyptians for control statements.

Anything besides this and you are Pajeet.
>>
>>62200263
int function(int a)
{
if (a){
return 1;
}
else {
return 0;
}
}


Please do not put a space in there.
>>
>>62200464
int function(int a)
{

if (a){

return 1;

}

else {

return 0;

}
}

Perfected that for you.
>>
>>62200464
This is madness

void foo (void) {
if (condition) {
statement;
}
else {
statement;
}
}
>>
tfw you join a project and it follows this shit
>>62200496
and you can't fix that.
>>
>>62196136
I generally strive to follow the recommended guidelines for the language I'm working in. However, if they recommend something fucking retarded like braces on separate lines, or spaces instead of tabs, then I'm not going to follow that. Those things are just objectively retarded.
>>
I don't care what language it is, the only correct way to format it is like this:

if (condition) {

} else {

}


This is the cleanest, neatest, and most readable. Each chunk of the if statement takes up exactly one line. With braces on new lines, the start of the if statement takes up two lines and the end of it takes up one line. That's messy and inconsistent.
>>
if (condition) {
// statement
}
else {
// statement
}

because that's the best format for Notepad++
>>
File: shrugs.jpg (78KB, 1300x863px) Image search: [Google]
shrugs.jpg
78KB, 1300x863px
>>62195990
I just do CTRL+A then CTRL+SHIFT+F. Works all the time.
>>
if (condition) {

} else if (true) {

}
>>
>>62195990
(if (conditional)
...
...)

Fixed.
>>
>>62199674
>>62200263
>>62200293
>>62200348
>>62200464
>>62200492
>>62200496
Truly awful.

(define (function a)
(if (a)
1
0))
>>
step aside brainlets
int result;

condition
? (result = 1)
: (result = 0);
>>
>not writing the whole program on one line
int main(){ if(true){ int i = 1; for(i=1;i>0;i++){ printf(i) } } return 0; }
>>
>>62201764
 
if (condition) { } else if (true) { }
>>
int function (int a)           {
if (a) {
return 1 ;}
else {
return 0 ;}}
>>
>>62202329
Smart.
>>
>>62199674
>karlie tier
bool b = a;
>>
>>62195990
...you program in (((lisp)))
>>
File: 1467758725925.jpg (125KB, 633x758px) Image search: [Google]
1467758725925.jpg
125KB, 633x758px
>>62195990
https://www.kernel.org/doc/html/v4.10/process/coding-style.html

If you are using any other coding style then you are fuckin retarded.
>>
You are autistic if you don't write it in single line like this
 if(condition){//statement}else{// statement} 

Prove me wrong
>>
File: 1503376940921.jpg (56KB, 565x708px) Image search: [Google]
1503376940921.jpg
56KB, 565x708px
>>62195990
I thought this until I had to read somone else's program in that style.

The real battle is between:

if (test) {
x++;
}
else {
x = 0;
}


vs.

if (test) {
x++;
} else {
x = 0;
}
>>
Is this thread a representation of that infamous Autism I've heard so much about?
>>
if
( condition )
{ //expression}
>>
File: wot.png (38KB, 538x257px) Image search: [Google]
wot.png
38KB, 538x257px
>>62199277
That doesn't mean much
>>
>>62195990
I'm sorry, man.

But fate has decided for me to be a PHP developer, and PSR-2, the one and only code style that all code bases that have a code style follow, dictates for it to be this way.

To be honest, I think python does it best. Why would you even need braces if you indent anyway?
>>
>>62199674
>>62200263
>>62200293
Ew, how awful.

>>62200348
Beat me.
Return in almost every language is an implied exit from an enclosure.
If it isn't, it is shit.
Redundant code is worst.
Even if you suddenly needed to add more complex code behind the return 0, say you wanted to return an error code to the caller, it's a trivial highlight and start typing "else {" etc.
Less work than highlight multiple lines, less overhead in code, less overhead when/if compiled / interpreted. It's wins all around.
>>
>>62200987
t. pythonista
Thread posts: 80
Thread images: 11


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.