OsmosysSoftware / dev-standards

Documentation for all the development category standards followed at Osmosys
2 stars 11 forks source link

.NET Coding Standard - Concern regarding number of chars to be used in single line as per standards #75

Open agrahari-himanshu opened 6 days ago

agrahari-himanshu commented 6 days ago

Documentation Link: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions#:~:text=Limit%20lines%20to%2065%20characters%20to%20enhance%20code%20readability%20on%20docs%2C%20especially%20on%20mobile%20screens.

The style guidelines says

Limit lines to 65 characters to enhance code readability on docs, especially on mobile screens.

As per understanding, the 65 chars is for codes on documents which can be used to provide examples of codes So that, if someone wish to read the document on the mobile screen, it is easy to read.

Concern: We should not mistaken this with the no of chars width for actual code Why? Since even for small to medium width devices having very less resolution, char length of 65 is very less.

Some ref which can be beneficial to make decision https://learn.microsoft.com/en-us/answers/questions/1007988/line-length-enforcement-for-visual-studio-and-dotn https://se-education.org/guides/conventions/csharp.html#:~:text=2.%20Maximum%20line%20length%20is%20130%20characters.

agrahari-himanshu commented 6 days ago

Possibly there are no rules to enforce line length

image

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options