Having the class with the variable and the method like this:
class TheClass
{
protected string tag_;
...
public string Tag()
{
return tag_;
}
}
the IDE suggests to replace the Tag()
method definition like this:
class TheClass
{
protected string tag_;
...
public string Tag() => tag_;
}
What are the pros and cons? Is the result of compilation and/or optimization of both versions the same?