Write a tiny bit less code
... with these low budget tips.
Arrays
string[] names = new string[2];
names[0] = "barry";
names[1] = "john";
Everybody knows you can do that. Most people also know you can do this instead:
string[] names = new string[] {"barry", "john"};
But did you know you can get away with as little as this?
string[] names = {"barry", "john"};
Delegates
Wiring up delegates is cumbersome...
ThreadPool.QueueUserItem(new WaitCallBack(MyMethod), null)
Or
_btn.OnClick += new EventHandler(_btn_Onclick);
However, you don't need to new up the delegate if you're feeling lazy, e.g.
ThreadPool.QueueUserItem(MyMethod, null)
_btn.OnClick += _btn_Onclick;
Better eh? Well shorter, think of all the keypresses we've just saved.
Coming soon
More low budget tips from thejoyofcode.com :)