J
john doe
A quick question, about so-called 'best practices', I'm interested in
which of A/B of the two examples people would choose, and why.
[A]
public enum MyEnum
{
Option1 = 0,
Option2 = 1,
Option3 = 2,
Option4 = 3
}
public enum MyEnum
{
Option1,
Option2,
Option3,
Option4
}
The second one:
[A]
public string Foo
{
get
{
return this.foo;
}
set
{
if ( this.foo != value )
return this.foo
}
}
public string Foo
{
get
{
return this.foo;
}
set
{
return this.foo
}
}
I'm also interested in best practices for null checks for paramters in
methods and other best practices. The Microsoft website has a few
(try/catch, chunky calls etc.) in its best practices page, but I'm
after a more comprehensive list.
Thanks
which of A/B of the two examples people would choose, and why.
[A]
public enum MyEnum
{
Option1 = 0,
Option2 = 1,
Option3 = 2,
Option4 = 3
}
public enum MyEnum
{
Option1,
Option2,
Option3,
Option4
}
The second one:
[A]
public string Foo
{
get
{
return this.foo;
}
set
{
if ( this.foo != value )
return this.foo
}
}
public string Foo
{
get
{
return this.foo;
}
set
{
return this.foo
}
}
I'm also interested in best practices for null checks for paramters in
methods and other best practices. The Microsoft website has a few
(try/catch, chunky calls etc.) in its best practices page, but I'm
after a more comprehensive list.
Thanks