Fixed layout conventions code example

This commit is contained in:
Stone-Red-Code
2021-07-08 22:03:04 +02:00
parent 3e75ce3aad
commit 9e07fa33fa
@@ -104,6 +104,24 @@ public bool IsAvailable()
- Add at least one blank line between method definitions and property definitions.
- Use parentheses to make clauses in an expression apparent, as shown in the following code.
```cs
//Do:
string password = Console.ReadLine();
if(password == "1234")
{
Console.WriteLine("Correct password!");
}
//Don't:
string password = Console.ReadLine();
if(password == "1234") { Console.WriteLine("Correct password!"); }
if(password == "4321")
{
Console.WriteLine("Correct password!");
}
```
## Commenting conventions
- Place the comment on a separate line, not at the end of a line of code.
@@ -111,14 +129,6 @@ public bool IsAvailable()
- End comment text with a period.
- Insert one space between the comment delimiter (//) and the comment text, as shown in the following example
```cs
string password = Console.ReadLine();
if(password == "1234")
{
Console.WriteLine("Correct password!");
}
```
```cs
//Do: