5
$\begingroup$

I'm not speak English very well, and I have a question about how I can call the symbols = / / .

To describe them with a word in Portuguese, we use sinal (signal).

Which is the correct term in English? I want a single word to describe all three symbols, not three separate words.

EDIT

I want knows the better term to use in my function name getConstraintSign.

export const getConstraintSign = function(constraint) {
    return constraint.greater ? '≥' : constraint.less ? '≤' : '=';
}
$\endgroup$
18
  • 2
    $\begingroup$ I think the word you're looking for is "sign," though "symbol" is perfectly good. $\endgroup$
    – saulspatz
    Mar 21, 2018 at 18:04
  • 1
    $\begingroup$ I think "sign" will do. But to be sure, show us a complete sentence where you want to use it. $\endgroup$ Mar 21, 2018 at 18:05
  • 1
    $\begingroup$ "sign" is overloaded, though, so be aware of the context. It also refers to the unary plus or minus sign indicating whether a number is positive or negative. $\endgroup$
    – user169852
    Mar 21, 2018 at 18:09
  • 1
    $\begingroup$ In this context, I would call it a relational operator, but if you don't like getRelationalOperator I would suggest getOperator. $\endgroup$
    – saulspatz
    Mar 21, 2018 at 18:35
  • 2
    $\begingroup$ Comparisons or relations. $\endgroup$
    – copper.hat
    Mar 21, 2018 at 18:43

1 Answer 1

1
$\begingroup$

In the program context you provide,

getConstraintSign

is fine.

getConstraintSymbol

would work too, and is a little more precise, since it's really a glyph (symbol) you're returning.

$\endgroup$
2
  • $\begingroup$ thanks for the answer, but the @saulspatz suggests use getConstraintOperator, my question continues the sames, how is the best term? I believe isn't a better term and all this terms are fine. Am I correct? $\endgroup$ Mar 21, 2018 at 18:43
  • 1
    $\begingroup$ There is no "best term". Any one of the three is clear enough so that someone reading your code will know just what the function does. I would use "symbol" but wouldn't object (wouldn't even comment) on the other choices in a code review. $\endgroup$ Mar 21, 2018 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .