Brace placement

Curly braces should open on a new line and close on a separate line, as shown in the next screenshot. After a closed curly brace, an empty line should follow. There are many people that recommend against open curly braces on a separate line. These guidelines are not set in stone, and you are free to choose what works best for you. Many developers, especially in the .NET space, would rather open curly braces on a new line:

When using parentheses, proper spacing is also important, to increase the readability of your code, as shown in the next screenshot. Usually, PowerShell does not care much about spaces; that's one thing you will need to learn when starting to write Python:

Lastly, when using compound conditions in statements, mark your conditions by using braces, to make the code more readable, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.12.172