#region How to get past those pesky code reviewers.


Well fortunately for you Microsoft has built a feature into c# which will let you take all that beautiful complexity and leetness and hide it. After you are done your files will appear to be only a matter of lines long. Just do:


#region Some OO sounding name, implying a ‘good design’ like FooObserver

//put some decoy code here something to make your code look structured

#region local variable declaration

//all your 1337 C0|)3



return bar;


#end region

//more decoy code here, a return statement is good, notice it is not reachable

return foo;




With any luck when you hand this off to your reviewer he will look at your regions, and think your class is very concise, and well structured, and just so long as he does not dig too deep he will let you check it in.


Seriously, regions are evil, their sole purpose is to make ugly code look pretty. Never use them, and if you are the reviewer be smart, and if code has regions return to sender.

Next Post