Skip to content

Instantly share code, notes, and snippets.

@leppie
Created October 11, 2013 14:28
Show Gist options
  • Save leppie/6935622 to your computer and use it in GitHub Desktop.
Save leppie/6935622 to your computer and use it in GitHub Desktop.
C# COMPILER, Y U MAKE ME SO MUCH CODE WHEN YOU SHOULD KNOW BETTER?
#if DEBUG
public static XYZ Normalize(this XYZ c, [CallerMemberName] string caller = "")
#else
public static XYZ Normalize(this XYZ c)
#endif
{
#if DEBUG // completely needless
Debug.Print("normalizing: {0} called from: {1}", c, caller);
#endif
return new XYZ
{
X = c.X / c.Y,
Y = 1,
Z = c.Z / c.Y,
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment