Just a follow up on Mouton's thread, what kinds of white space do you use when programming in a C-syntax language (C, C++, Java, PHP, C#)?
Pick from these examples:
public class Test()
{
private string _Name;
private DateTime _DateOfBirth;
public Test()
{
}
public string Name
{
get { return _Name; }
set { _Name = value; }
}
public DateOfBirth Age
{
get { return _DateOfBirth; }
set { _DateOfBirth = value; }
}
public virtual void ThisIsAFunction()
{
// Blah!
}
}
public class Test()
{
private string _Name;
private DateTime _DateOfBirth;
public Test()
{
}
public string Name
{
get { return _Name; }
set { _Name = value; }
}
public DateOfBirth Age
{
get { return _DateOfBirth; }
set { _DateOfBirth = value; }
}
public virtual void ThisIsAFunction()
{
// Blah!
}
}
public class Test()
{
private string _Name;
private DateTime _DateOfBirth;
public Test()
{
}
public string Name
{
get { return _Name; }
set { _Name = value; }
}
public DateOfBirth Age
{
get { return _DateOfBirth; }
set { _DateOfBirth = value; }
}
public virtual void ThisIsAFunction()
{
// Blah!
}
}
I'm a "Example 1" type person. I have a new line between each "block" of code. I think it separates the different areas very nicely. What about you?
Question
Sn1p3t
Just a follow up on Mouton's thread, what kinds of white space do you use when programming in a C-syntax language (C, C++, Java, PHP, C#)?
Pick from these examples:
public class Test() { private string _Name; private DateTime _DateOfBirth; public Test() { } public string Name { get { return _Name; } set { _Name = value; } } public DateOfBirth Age { get { return _DateOfBirth; } set { _DateOfBirth = value; } } public virtual void ThisIsAFunction() { // Blah! } }public class Test() { private string _Name; private DateTime _DateOfBirth; public Test() { } public string Name { get { return _Name; } set { _Name = value; } } public DateOfBirth Age { get { return _DateOfBirth; } set { _DateOfBirth = value; } } public virtual void ThisIsAFunction() { // Blah! } }public class Test() { private string _Name; private DateTime _DateOfBirth; public Test() { } public string Name { get { return _Name; } set { _Name = value; } } public DateOfBirth Age { get { return _DateOfBirth; } set { _DateOfBirth = value; } } public virtual void ThisIsAFunction() { // Blah! } }I'm a "Example 1" type person. I have a new line between each "block" of code. I think it separates the different areas very nicely. What about you?
Link to comment
Share on other sites
6 answers to this question
Recommended Posts