Well?
Well?
Right.
I'm not a programmer and I can tell that "left" is the correct choice because it is more aesthetically pleasing and logical.
One is Html the other one is code
It depends on the language I'm using. I use the left for C and the right for Java.
I do right for most stuff since it's usually only a few lines in a loop/if. functions and namespaces i do left.
right is the original style used by the creators of the C language
Right.
Left is gay.
Doesn't matter in real life, stop bitching about nonsense and do something productive.
Your dad is ashamed of you.
Whichever is the standard where I work. When writing private projects, I prefer left, unless this goes against the standard of given language.
So for example, in Java right is the usual standard, so that's what I use, but in C++ there are no clear common standard for code style, so I'll use left.
Depends on the code style for the language I'm in.
Left. I find it makes things a lot more readable when glancing quickly.
this
left is more aesthetic and looks comfy, but consistency is more important
I use the right side. Making it look prettier is nice, but wasting entire lines just for the sake of it looking prettier annoys me. I avoid bracketless loops and conditionals too (unless it's a self-contained loop) which may seem contrary to this principle, but the fact is that every time I've used bracketless control I've added lines and forgotten to add brackets at some point.
Right for functions.
But left for JSON.
Amazing argument, you've convinced me.
There's only one true brace style!
Do you guys do:
someProperty
&& someOtherProperty
or:
someProperty &&
someOtherProperty
>not using superior
if (Condition) { Statemens /* ... */ }
Follow coding style of project.
Here is mine:
/**
* @brief descripton of func
* @var input to func
*/
void exampleFunc(int input)
{
if(input == enum_defined_elsewhere) {
ClassName ex;
ex.runOtherFunc();
}
}
I was a hardcore left-autist for a long time, but then I realized that nested if statements become absolute visual cancer... all that wasted vertical space..
since then I have left the left (hehehe) and come to the right conclusion (HEHEHEE)
first. so you can just remove the line
test
//&& test2
&& test3
I don't care what you use
I'm using left before until my professor told me to use the right one because it makes the code easier to read
left. not a programmer myself, but i know how to program
But 2nd is more aesthetic?
The first line just annoys me.
I might actually go as far as:
true
&& test1
&& test2
&& test3
statement&&(
statement1
statement2)
Right
But still use a space between the if and statement
Whichever one is the standard for the project.
Always right, but left for classes on OO languages
Right, but left for functions.
I'm convinced too
What if you are the lead dev and you get to choose the style?
I would probably use right myself and choose it for the coding style, but I wouldn't give a fuck if I saw someone using left in their code as long as it worked.
That being said, I would rather work somewhere where there was few enough build issues that people actually cared this much about coding style.
us koders, amirite?
Right
>Only programmers will understand this
And only """"""""""""""""""""""""""""""""""programmers"""""""""""""""""""""""""""""""""" care about this. Pay attention to class you future pajeets, stop ruining my industry.
The right one takes a line less in your project
Left.
Right is gay.
I write my code in a single line rookie
right for functions, left for classes
Right, left is a waste of space
Left for C++ & C#
Right for everything else
Stop feeding into left-right polarization
>le only programmers know meme
>t. been fucking around with programmig for a few months
an actual programmer would know to use whatever the fuck the existing codebase uses, and when creating a new codebase use the programming language's established conventions
Always right except in the case of function declarations.
>JSfags
Right is for conditionals, left is for declarations
I use left. I used to use right to save a line of code until I realized my JS is minified by a preprocesser.
Right.
>writing JSON
Isygddt in 2017.
Right is the only logical option.
Left is fucking gay shit.
I used to use right but I'm training myself in the left style because it's easier to read when having long, dense code.
kys
Left for functions, right for everything else
the visual separation of arguments and variables make the code feel a lot less cluttered
Use both in the same code when it looks good
...
Your argument is sound but your autism is showing.
...
I don't like the curly brace inconsistency
?:
Both are wrong because they use tabs instead of two spaces for indentation.
What? The other one works as well.
test &&
// test2 &&
test3
The only advantage is being able to comment out the last vs the first line.
Right.
I don't like having an extra line for the damn '{'
Takes me long enough to scroll through things as it is.
Just set tabs to 2 spaces in your editor. This is why people use tabs in the first place.
>using a curly brace language
people still do this?
>being a hipster
Right.
t. JS dev
Left, right is Javascript brainlet tier
>not using superior superior
if (condition) return true;
If you actually did that would you be yelled at
Left for functions with side effects, right for any other block.
No, it's common af.
server.get('/friends', (req, res) => {
FriendSchema.find({}, (err, data) => {
if (err) throw err;
res.json(data);
});
});
Also, please use a comma next time. Your question confused me.
I understood this. Does that mean I can call myself a programmer?
Right
On a related note, fuck anyone who does } else { on one line.
here, simplified it a bit
server.get('/friends', (req, res) => {
FriendSchema.find({}, (err, data) => {
throw err;
});
});
if (condition) {
return true;
} else { // better looking
return false;
}
else { // than this
}
I hate the left. The right is just so much more comfy and aesthetically pleasing
Incorrect.
y
you have no friends that's y
Left
That's a mean thing to say, user.
i'm only projecting :( sorry about that
too cramped:
if (condition) {
return true;
} else {
return false;
}
too much space:
if (condition)
{
return true;
}
else
{
return false;
}
just right:
if (condition) {
return true;
}
else { // better looking
return false;
}
Why are you ever throwing an error? Handle that correctly.
import { FriendSchema } from './listOfShittySchemas'
import { failElegantlyAndLog } from './whatever'
...
server.get("/friends", (_req, res) =>
FriendSchema.find({ /* Why is this empty obj a thing? Don't. */ }, (err, data) => {
(err
? () => res.json(failElegantlyAndLog(err))
: () => res.json(data)
)();
})
)
But I also wouldn't use lolcallbacks
server.get("/something", async (req, res) => do {
try {
const data = await FriendSchema({ id: req.body.user_id })
res.json(data)
}
catch(err) {
res.json(failElegantlyAndLog(err))
}
})
haha no.
if (condition) {
// WTF? Two space indents?
// What are you, gay?
return true;
} else {
// >not using } else {
// ISHYGDDT
return false;
}
I just started learning this shit 2 days ago.
That's the way my instructor showed us. Is it wrong? Care to explain why? Instructor is bootcamp grad, but has lots of professional experience. I always thought he didn't know what the fuck he was talking about, though.
I take a BASH approach to my C code. If it doesn't fit in one line, it's wrong.
>I'm not a programmer
Opinion discarded
Oh, if you're that new that's fine. ECMAScript has grown up a lot lately and your code is what a lot of older Node codebases looked like.
Async/Await is pretty standard for current Node code being written, while the `do` expression I threw in there (1) isn't necessary and (2) doesn't have widespread adoption yet.
No matter what language you're in please handle errors, though. :)
Left for C#
Right for Java
This is the only correct answer.
>I would probably use right myself and choose it for the coding style, but I wouldn't give a fuck if I saw someone using left in their code as long as it worked.
Set up a git prehook to run style on code with predefined settings.
right
Right
>empty line and then combining closing brace and else
Right... Or depends on the company style
What's the correct way of indenting #if preprocessor directives within functions Sup Forums?
always@(*) begin
if (Condition == 1'b1) begin
x
>using the C preprocessor for anything other than includes
cancer