Author Topic: One-liner conditional statements  (Read 3069 times)

Ivan N. Zlatev

  • Community Member
  • Posts: 87
  • Hero Points: 5
One-liner conditional statements
« on: June 13, 2007, 08:14:49 am »
I don't use parathesis for 1 liner conditional statements and since I happen to use a lot of those, the automatic insertation of paranthesis became annoying and I've disabled it. The issue is when I refactor code I get to either indent the 1-liners body of the conditional statement myself or to type in {, surround the next line and then delete the { and }. Not very nice. Does anyone have a suggestion to go about not having parenthesis for 1 liner conditional statements and not having to do the described?

if (param == null)
   throw new ArgumentNullException("param");
« Last Edit: June 13, 2007, 10:02:41 am by i-nZ »