If you read
IntRectangle Rectangle;
you already know that it is a rectangle of integers;
If you read something like
Recti Rectangle;
Rectanglei Rectangle;
it would not be that obvious. (I would have to think for a short time if those were simple typedefs or types on their own or whatever...I hope you get what I mean to say.)
I actually don't really understand what would be the problem whenever Recti was a typedef of a "type on its own" ? Otherwise it's only a point of view. After having used OpenGL (glVertex2i, glVertex3i, glVertex3f...) I'm quite used to the "type{dimension}{type}" naming style.
Now here is what I wrote on the French forum :
If I could change everything, this is what I would use :
Point*i/Point*f
Sizei/Sizef
Recti/Rectf
Because I think there should be a distinction between points and sizes. A size should never be negative, whereas the members of a point could (and because to me "vector" is not enough explicit). I know explanations have been given about negative size (allows inverted object drawing) but I think this is short and simple solution, but absolutely not an intuitiv one.
If I had to stay with the current vectors, here is what I'd use :
Vec2f / Rectf / Vec2i / Recti
Keeping Vector/Rect is inconsistent and to me Vector/Rectangle is too long (but I agree this last point is quite discussable and is only a question of point of view).
P.S.: I've read some complaining that if Rect was to be used instead of Rectangle, the developer would not be able to determine whether it was a type or a variable (see
here (french)). This actually depends on your naming conventions : I always use capital for the first letter of a type's name and a lowercase letter for variables.
And... I've just been noticing a major point :
I think it fits the SFML naming convention most (like RenderTarget, WindowSettings, VideoMode etc.).
Recti & co does absolutely not follow this naming convention. Maybe the whole SFML naming convention should be updated (the question does not only concernes these little vectors
). I prefer OpenGL naming convention, thus if I was the only one to be asked, SFML would already follow this convention. But as I'm not, this should be discussed deeper, especially with the one developping SFML (hum... no.. really.. wonder what's his name :lol: ).