C# indentations | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# indentations

I just started learning C#. I notice that the STATIC MAIN VOID and all those other lines that go before the MAIN function, each line is indented. Is that mandatory to indent each line? Like the one that is sololearn program, the next line is I think SOMETHING CLASS and then the STATIC MAIN VOID. Any feedback would be greatly appreciated, thank you

10th Feb 2022, 8:23 PM
Jermainne Espinoza
6 Answers
+ 5
No in many languages indentation is not mandatory because you can use curly braces { } which denotes the block of code. But if you want to make more readability of code then you can indent code.
10th Feb 2022, 9:10 PM
A͢J
A͢J - avatar
+ 3
While it is not mandatory to indent lines, it makes it so much more readable though. Some IDEs, such as Visual Studio, will auto-format your code to a certain extent to follow a common style practise. And you ought to learn about and apply those coventions.
10th Feb 2022, 9:13 PM
Ani Jona 🕊
Ani Jona 🕊 - avatar
+ 1
Thank tou
10th Feb 2022, 9:10 PM
Jermainne Espinoza
+ 1
Thank you very much
10th Feb 2022, 9:14 PM
Jermainne Espinoza
0
Thank you
10th Feb 2022, 9:11 PM
Jermainne Espinoza
0
You're welcome :)
10th Feb 2022, 9:14 PM
Ani Jona 🕊
Ani Jona 🕊 - avatar