views:

106

answers:

6

Is there a convention for the order of (height, width) in function arguments or when displaying dimensions?

+3  A: 

I'd say (width, height) is overwhelmingly more common. It never hurts to make it explicit though (through argument naming, etc)

Matti Virkkunen
+1  A: 

I don’t know if there is a convention elsewhere but personally I always use the convention used by graphics (usually even outside of computing, e.g. in photography): width before height.

Konrad Rudolph
+6  A: 

I don't know a huge number of languages, but what I have used go with (width, height). It's more fitting along the lines of (x, y) coordinates.

Tesserex
+1  A: 

The (width, height) seems to be more common all around.

Sarfraz
+1  A: 

it is exactly width-height

stista
+1  A: 

In the door and up the stairs. That's the mnemonic I was taught for map co-ordinates.

puppybeard