Remy Porter’s CodeSOD article in The Daily WTF, published on September 30, 2026, examines code from Fritz’s team. The task was to determine whether one point lay within a specified distance of a center point.
private bool IsWithin(Point point, int radius)
{
for (int x = -radius; x < radius + 1; x++)
{
for (int y = -radius; y < radius + 1; y++)
{
if ((PositionX == point.X + x) && (PositionY == point.Y + y))
return true;
}
}
}The C# method `IsWithin(Point point, int radius)` loops through x and y offsets from `-radius` through `radius`. For every integer coordinate in that square, it compares `PositionX` with `point.X + x` and `PositionY` with `point.Y + y`. A matching pair makes the method return `true`, so the implementation is limited to integer point values.
The scan covers a square region. It does not calculate a conventional circular distance. Porter notes that a distance formula would fit the original question, while direct bounds checks would be simpler if a box was the actual requirement. The example’s technical joke is a brute-force search for a small geometry problem.




Comments
No comments yet — be the first.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.