I was just debugging some code that looked like this:
string someValue = _snuh.FindItem(id).Value;
I wanted to inspect the return value of FindItem()
(it returns a Foo
), so I broke the code into two lines:
Foo foo = _snuh.FindItem(id);
string someValue = foo.Value;
This allowed me to look at foo in the debugger; something I wasn't able to do when the code was all on one line.
Now that I'm done debugging, should I put the code back the way it was, or leave it as two lines?
The two lines are better than the one liner:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With