A simple question as to whether or not this would be a proper way to combine logical statements for readability and organization purposes.
The 'standard' way I was taught to write code:
txtbox_vendor.Visible = false;
txtbox_vendor.Enabled = false;
txtbox_vendorCity.Visible = false;
txtbox_vendorCity.Enabled = false;
txtbox_vendorState.Visible = false;
txtbox_vendorState.Enabled = false;
Now obviously if I have a huge amount of textboxes or any objects that are being being switched on and off, would it be better to write it like this:
txtbox_vendor.Visible = false; txtbox_vendor.Enabled = false;
txtbox_vendorCity.Visible = false; txtbox_vendorCity.Enabled = false;
txtbox_vendorState.Visible = false; txtbox_vendorState.Enabled = false;
Obviously, performance isn't going to be an issue.
But is the second option considered a correct way to write code for legibility? Or is it frowned upon?