R
Robert in SF
Guest
I have code like this
var form = new GetDate();
form.Text = "Assigned";
form.PreviousDate = txtEntered.Tag as DateTime?;
form.txtDate.Text = txtAssigned.Text == string.Empty ? DateTime.Now.ToString("MM/dd hh:mm") : txtAssigned.Text;
form.ShowDialog();
Visual Studio would rather this code be like this
var form = new GetDate
{
Text = "Assigned",
PreviousDate = txtEntered.Tag as DateTime?
};
form.txtDate.Text = txtAssigned.Text == string.Empty ? DateTime.Now.ToString("MM/dd hh:mm") : txtAssigned.Text;
form.ShowDialog();
Ok, but why? The VS suggestion seems less readable to me. Is there a compiled benefit?
Continue reading...
var form = new GetDate();
form.Text = "Assigned";
form.PreviousDate = txtEntered.Tag as DateTime?;
form.txtDate.Text = txtAssigned.Text == string.Empty ? DateTime.Now.ToString("MM/dd hh:mm") : txtAssigned.Text;
form.ShowDialog();
Visual Studio would rather this code be like this
var form = new GetDate
{
Text = "Assigned",
PreviousDate = txtEntered.Tag as DateTime?
};
form.txtDate.Text = txtAssigned.Text == string.Empty ? DateTime.Now.ToString("MM/dd hh:mm") : txtAssigned.Text;
form.ShowDialog();
Ok, but why? The VS suggestion seems less readable to me. Is there a compiled benefit?
Continue reading...