Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elvis operator etymology

According to Wikipedia, the binary operator ?: is

colloquially referred to as the Elvis operator due to its resemblance to an emoticon.

My question is:

  • Does the name have anything to do with Elvis Presley?
  • How exactly does it resemble Elvis?
like image 868
Patryk Golebiowski Avatar asked Mar 07 '16 12:03

Patryk Golebiowski


People also ask

What is Elvis operator in Java?

Elvis operator (?:) is used to return the not null value even the conditional expression is null. It is also used to check the null safety of values. In some cases, we can declare a variable which can hold a null reference.

Which operator is called ternary operator?

In computer programming, ?: is a ternary operator that is part of the syntax for basic conditional expressions in several programming languages. It is commonly referred to as the conditional operator, inline if (iif), or ternary if. An expression a ? b : c evaluates to b if the value of a is true, and otherwise to c .

When would you use Elvis operator in Kotlin?

Elvis Operator (?:)It is used to return the not null value even the conditional expression is null. It is also used to check the null safety of values. In some cases, we can declare a variable which can hold a null reference.

What is Elvis operator?

In certain computer programming languages, the Elvis operator, often written ?:, or or ||, is a binary operator that returns its first operand if that operand evaluates to a true value, and otherwise evaluates and returns its second operand.

What is Elvis operator in Kotlin?

Kotlin Elvis Operator (?:) Elvis Operator (?:) It is used to return the not null value even the conditional expression is null. It is also used to check the null safety of values. In some cases, we can declare a variable which can hold a null reference.

What is the origin of the name Elvis?

More likely, it is from the rare surname Elvis, a variant of Elwes, which is ultimately derived from the given name Eloise. The name was brought to public attention by the singer Elvis Presley (1935-1977), whose name came from his father's middle name. This name is also used as an Anglicized form of Irish Ailbhe.

What is the origin of the word operator?

operator (n.) 1590s, "one who performs mechanical or surgical operations," agent noun from operate (v.) or from Late Latin operator "a worker." Meaning "one who carries on business shrewdly" is from 1828. Specific sense of "one who works a telephone switchboard" (1884) grew out of earlier meaning "one who works a telegraph" (1847).


1 Answers

Yes, it relates to Elvis Presley because it kinda resembles his hair style:

Elvis emoticon

Reference: https://stackoverflow.com/a/1993455/432311

like image 175
rmp251 Avatar answered Oct 23 '22 08:10

rmp251