常量命名麻烦:两个直角三角形
我正在尝试为两个可以旋转的直角三角形提供适当的常量名称。
上图显示了直角三角形的两个不同版本。橙色三角形的直角位于右下角,蓝色三角形的直角位于左下角。
由此,我们假设我将每个常量命名为:
public static const RIGHT_ANGLE_BOTTOM_RIGHT:String = "rightAngleBottomRight";
public static const RIGHT_ANGLE_BOTTOM_LEFT:String = "rightAngleBottomLeft";
除了这些常量名称很长并且描述性不强之外,这些三角形还可以旋转。因此,如果橙色三角形 (RIGHT_ANGLE_BOTTOM_RIGHT
) 旋转 -90°,则其名称现在会产生误导(并且存在冲突),因为它的直角现在位于三角形的左下角。
所以我正在寻找这些可旋转的直角三角形的常量名称,这些名称清晰且有区别(并且最好短)。目前,我的“最好”只是简单地称它们为类型 1 和类型 2。虽然这些名称毫无疑问是有区别的,但它们的形状肯定一点也不清楚,特别是因为它们可以旋转。
package
{
public final class TriangleStyle
{
public static const ISOSCELES:String = "isosceles";
public static const RIGHT_Type1:String = "right1";
public static const RIGHT_Type2:String = "right2";
}
}
有什么想法吗?
i'm trying to come up with appropriate constant names for two right-angled triangles that can be rotated.
the image above shows the two different versions of a right-angled triangle. the right angle of the orange triangle is in the bottom-right while the right angle of the blue triangle is in the bottom-left.
from that, let's assume i will name each constant as:
public static const RIGHT_ANGLE_BOTTOM_RIGHT:String = "rightAngleBottomRight";
public static const RIGHT_ANGLE_BOTTOM_LEFT:String = "rightAngleBottomLeft";
besides those constant names being quite long and not very descriptive, these triangles can be rotated. therefore, if the orange triangle (RIGHT_ANGLE_BOTTOM_RIGHT
) is rotated -90º, its name is now misleading (and conflicting) since its right angle is now in the bottom left of the triangle shape.
so i'm searching for constant names for these rotatable, right-angled triangles which are clear and distinguishing (and ideally short). currently, my "best" is simply calling them type 1 and type 2. while those names are unmistakably distinguishing, it certainly isn't at all clear of their shape, especially since they can be rotated.
package
{
public final class TriangleStyle
{
public static const ISOSCELES:String = "isosceles";
public static const RIGHT_Type1:String = "right1";
public static const RIGHT_Type2:String = "right2";
}
}
any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许是
HOA
和HAO
——我将把推导留给你——并注意这些名称在旋转下是不变的。Perhaps
HOA
andHAO
-- I'll leave the derivation to you -- and note that these names are invariant under rotation.