I work in an awesome place holding pretty high code quality standards, so very little comes to mind.
I have one tiny nit-pick: brackets for one-line if statement in C#
Example:
if(cookies.Any()){Console.WriteLine("Awwwww yisss, cookiieeeessss!!");}else{Console.WriteLine("Oh noes, need cookies!")}
My personal preference
if(cookies.Any())Console.WriteLine("Awwwww yisss, cookiieeeessss!!");elseConsole.WriteLine("Oh noes, need cookies!")
Less code to read, the better. {} add unnecessary noise.
Note: Standards can change and I have an opportunity to change the existing standard. But all propositions are taken to developer votes (you know, democracy style)
From coding in C and C++ in the past, I like the security having the braces bring but I also like the brevity of not having to use them. I've kind of ended up in the use brackets camp because, in the long run, it makes the code easier to read for more people.
if (someRatherLongBooleanCheck)
doSomething()
if (someOtherRatherLongBooleanCheck)
doSomethingElse()
doNotLookAtMe()
if (imJustHereToDistractYou)
andWeAreDone()
I work in an awesome place holding pretty high code quality standards, so very little comes to mind.
I have one tiny nit-pick: brackets for one-line
if
statement in C#Example:
My personal preference
Less code to read, the better.
{
}
add unnecessary noise.Note: Standards can change and I have an opportunity to change the existing standard. But all propositions are taken to developer votes (you know, democracy style)
I've been kind of back and forth on this.
From coding in C and C++ in the past, I like the security having the braces bring but I also like the brevity of not having to use them. I've kind of ended up in the use brackets camp because, in the long run, it makes the code easier to read for more people.
Hmm, what type of security do they provide to you? I’m interested now :)
See Paritosh' comment in this thread.
In short:
Or for a concrete example, the "goto fail" bug from a couple of years ago:
imperialviolet.org/2014/02/22/appl...