C
C#3y ago
Gladiator

Avoid line break and wrapping (Formatting in rider)

What is the most common way to format codes in rider when a line is long? Break lines or wrapping. Line break can cause awkward weird ugly codes
11 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Gladiator
GladiatorOP3y ago
I want to know which way is more popular Line breaking when formatting or ..
ero
ero3y ago
What's the difference? They're both line breaks
Gladiator
GladiatorOP3y ago
I have seen some developers not break lines, instead set a setting (which I forgot) in rider for example to avoid line breaking It continues to the next line but not break
ero
ero3y ago
Oh. Yeah no i wouldn't do that The setting would be called something like line wrap or word wrap But again, not recommended
Gladiator
GladiatorOP3y ago
yes, true
ero
ero3y ago
I'd break sensibly, probably somewhere around 140 characters
Gladiator
GladiatorOP3y ago
Because, my parameters sometimes have long names and it is awkward to break it everywhere Good suggestion Also, one line for each argument is better I guess when it is broken
ero
ero3y ago
That's what I'd do
void M(
T1 arg1,
T2 arg2)
{

}
void M(
T1 arg1,
T2 arg2)
{

}
Gladiator
GladiatorOP3y ago
I think in vs code, it is done automatically but in rider I have not seen it It just breaks (one line to two lines) If rider does it automatically when formatting, it will be perfect. When line is long, break it smartly, one line for each argument
blinkbat
blinkbat3y ago
each line is different. show an example typically I break on chained method calls or lambdas my boss despises this and calls it "building towers" but it's still the most readable to me so i keep doing it
Want results from more Discord servers?
Add your server