views:

154

answers:

9

The title is fairly self-explanatory, but I'll reiterate: What would be a good variable name for a rectangle that describes an objects position and size.

EDIT - The object is a paddle for a Pong-like game, and there is already a rectangle named 'bounds' to restrict where the paddle can be moved to.

I ended up going with 'bounds' for the paddles position and size, and 'movableArea' to restricted where the paddle can be moved.

+1  A: 

BoundingBox might be good.

Alex Martelli
+1  A: 

How about boundingBox or boundsRect?

Arnold Spence
A: 

Apple's Cocoa framework uses frame and bounds (with slightly different meanings) for this kind of variable. I've always found them to be good. If you need just one, I vote for frame.

BJ Homer
A: 

Well, if the variable is of type Foo I would choose

fooRectangle

Or something similar to that. It also depends on the language and what the conventions are and perhaps the context.

BobbyShaftoe
+4  A: 

If it's a paddle, then why not paddleBound? That's not rocket science, it describes the object and its property and should be enough to distinguish it from anything else, except maybe the other paddle (then you can just use paddel1Bound or userPaddleBound for further distinction).

paxdiablo
A: 

I prefer short. How about xyBox?

le dorfier
+2  A: 

Given the context of your question, why not Paddle?

Demi
A: 

How about perimeter?

A: 

what about this ?

Rectangle nextBounds; // bounds where the paddle can be moved to

Rectangle bounds; // current bounds

Santhosh Kumar T