>space between "if" and left parenthesis
It's like you hate your code
>>63456474
what's wrong with the space?
Which one is better Sup Forumsentoomen?
Waste of space and it's ugly.
>C, C#
Left.
>Java, Javascript and friends
Right.
You probably write all of your code in lower case as well, dumb cuck
Condition ? statement_1 : statement_2;
>statement
Syntax error
if(cocks){
...
}//end if(cocks)
I use camelCase because all lowercause necessitates the use of underscores which is another thing that wastes horizontal space and looks ugly.
if (Condition)
Statements;
iUseCamelCaseBecauseAllLowercauseNecessitatesTheUseOfUnderscoresWhichIsAnotherThingThatWastesHorizontalSpaceAndLooksUgly
i_use_camelcase_because_all_lowercase_necessitates_the_use_of_underscores_which_is_another_thing_that_wastes_horizontal_space_and_looks_ugly
if (condition)
statement;
but is easy to read
>2011+6
>caring about horizontal space
>I literally never have multiple files open side by side
why would you ever need a comment, unless you're writing awful code like pic related it shouldn't be needed
Neither of them matter
(condition)
? (sub_condition)
? // code
: // mode code
: true /(if there are no more statements)
Left is allman style
Right is 1TBS (I think)
You should use whatever your organization requires you to use and you should use it consistently.
What do you do for else if, fucknugget?
Literally depends in who I'm working for at the time.
Really depends on how complex the condition is and whether or not the open bracket is aesthetically obvious.
for( int i=1; i
DID YOU WRITE f (x) BACK IN SCHOOL TOO? DIP SHIT
if(/* condition */) {
/* statements */
}
IS THE ONLY RIGHT WAY
if is not a function, shitbrain.
Condition ? statement_1 : Condition2 ? statement_2 : do_nothing;
mind blown
this
I'm sure you're aware that only works if the statement is one line
>what is word wrapping
that sounds terrible
Whatever the language you're using says is common practice
Otherwise talk it out with your team.
As long as it's consistent throughout the project it does not matter
...
if isn't a function, faggot
Horstmann style is pretty nice.
if (condition)
{ statement;
statement;
statement;
}
java is closer to c# than it is to js tho
if Condition:
Statements
> Nested Ternary
Holy shit you're an evil person
no
i unironically like this
Enjoy your diffs being an awful mess whenever you add a new statement at the start of the block.
What do you do when the line of code is too long?
I just use my own diff
if isn't a fucking function