Archived issue #0031317
Foundation Classes - confusing overloads of method gp_XY::SetCoord()
Description
Method gp_XY::SetCoord() has two overloads:
void SetCoord (const Standard_Integer Index, const Standard_Real Xi);
void SetCoord (const Standard_Real X, const Standard_Real Y);
This is quite confusing because the user aware of existence of the second method can call SetCoord (1, 0) assuming that the vector should be set to [1, 0], but instead this call will set X to 0.
void SetCoord (const Standard_Integer Index, const Standard_Real Xi);
void SetCoord (const Standard_Real X, const Standard_Real Y);
This is quite confusing because the user aware of existence of the second method can call SetCoord (1, 0) assuming that the vector should be set to [1, 0], but instead this call will set X to 0.
Public activity
1 archived note
Participants are labeled by their role within this record.
This is one of the drawbacks of abbreviations. In our code here we would write "SetCoordinates" and "SetCoordinate" and there would be no confusion. :)