>>7749057[code:lit]
int happiness;
// stuff that doesn't use happiness, allocates a local var that will be garbage collected when function returns
happiness = INFINITY;
return happiness;
[/code:lit]
This would not pass code review and I might even complain to our manager if you continued to write stuff like this.
This is better:
[code:lit]
private static readonly happiness = INFINITY;
private static int updateDesktop(ref Image wallpaper) {
MyDesktop.wallpaper = wallpaper;
return happiness;
}
[/code:lit]
Also, don't use Java or C#. use C++ instead.