Should I use && and || operators at the end of a line or beginning? [Answered]
if (a
b
c)
{
}
vs.
if (a
b
c)
{
}
Which is the more accepted standard? I just want to stop questioning myself every time I encounter this. Thanks.
10 Replies
use three ` to start and end blocks of formatted code
i personally think that if you have boolean conditions long enough to span multiple lines... they should be split up, one way or another
boolean logic is hard enough to parse as-is
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/Oh man, this question.
I never know what to do for this - I think I tend to write code both ways and I have never decided which is easier to read.
The former
I tend to want to align things, so
instead of
Although fairly sure I don't actually have a consistent style there and use both lol
I do this. I find it far more readable
Alright, it seems like it's still debatable, I won't feel guilty for choosing one over the other. 🙂
Thank you for your feedback. And thanks for the tips for posting code; I wasn't sure it would work in this discussion thread format.
You chose a good topic name
Drew the flies like honey 😄
✅ This post has been marked as answered!