Is it (width, height) or (height, width)?
Is there a conven开发者_JAVA技巧tion for the order of (height, width) in function arguments or when displaying dimensions?
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.
I'd say (width, height) is overwhelmingly more common. It never hurts to make it explicit though (through argument naming, etc)
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.
The (width, height) seems to be more common all around.
it is exactly width-height
In the door and up the stairs. That's the mnemonic I was taught for map co-ordinates.
Display resolution is also normally quoted in "width × height".
Wikipedia link to Display Resolution
精彩评论