where should this check logic go?
- by Benny
I have a function that draw a string on graphics:
private void DrawSmallImage(Graphics g)
{
if (this.SmallImage == null) return;
var smallPicHeight = this.Height / 5;
var x = this.ClientSize.Width - smallPicHeight;
var y = this.ClientSize.Height - smallPicHeight;
g.DrawImage(this.SmallImage, x, y, smallPicHeight, smallPicHeight);
}
the check if (this.SmallImage == null) return; should be in the function DrawSmallImage or should be in the caller? which is better?