Jun. 20th, 2011

andrewducker: (Default)
I want to be able to retrieve a value and then branch on its value, all in
one step. For some reason it irks me to have to say:
var blah = GetBlah();
if(blah != null)
{
//Do Stuff With blah
}

I want to say

if((var blah = GetBlah) != null)
{
//Do stuff with blah
}

I'm not sure why the extra line bothers me - possibly because it's a
pattern I keep having to repeat in my code, and any pattern I repeat irks
me after a while. That's why computers are there, to stop you having to do
the same thing over and over again.

December 2025

S M T W T F S
 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 18th, 2025 07:12 am
Powered by Dreamwidth Studios