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#

Do I need to put spaces before typing codes?

I'm just curious because I just notice that there are codes that have spaces after the line number and there are none...How can I know if I need to put spaces before typing the codes? or does it even matter if there is a space or none?

2 Answers

To elaborate on Henriks response; Indenting code inbetween curly braces has just become standard practice. Some software like Visual Studio even does the formatting automatically for you.
Generally speaking, every time you type an open curly brace ( { ) you indent one time by pressing Tab, and every time you type a closed curly brace ( } ) you undo one indent by pressing Shift + Tab. But as I said, most coding software you'll use in the future (outside of Treehouse) probably does this by default.

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points
if (condition)
{
  Console.WriteLine("Some text");
}

in case you are thinking about the code between { } then it's to make it easier to read the code.