Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Why some line number does not have codes? How will I know if I need to leave some number line without a code?

Below is an example of what I'm talking about, as you can see line number 7 and 11 does not have any codes...so why is that?... is that necessary for coding?

1 class Program 2 { 3 static void Main() 4 { 5 // Prompt the user for minutes exercised 6 Sytem.Console.Write("Enter how many minutes you exercised: "); 7
8 // Add minutes exercised to total 9 // Display total minutes exercised 10 // Repeat until the user quits 11
12 }
13}

2 Answers

It is absolutely not required to put empty lines in your code, but adding one empty line after small blocks of code (loops, if-else clauses, methods, etc.) just helps with readability.

Thanks emmuster! :)