New Word: Ternariholic (ternaryholic, ternaryolic, ternary-holic)

As you may know, I like to make up words, like Plattribution.

And now, here's another:


[tur-nuh-ree-haw-lik, -hol-ik]

1. of, pertaining to, or of the nature of ternary operations.
2. containing or using ternary operations.
3. caused by ternary operations.
4. suffering from ternariholism.

5. Pathology . a person suffering from ternariholism.
6. a person addicted to using ternary operations for shorthand notation, even at the expense of legibility.

Alternative spellings:
ternaryolic, ternaryholic, ternary-holic

1. John writes code as compact as he can. He likes to nest ternary operator assignments so much, I'm worried he might be a ternariholic.

2. This code is a ternariholic mess, which makes it really difficult to read.

3. Hi, I'm John and I'm a ternariholic. It's been 3 hours since my last ternary assignment. I'd like to apologize to anyone who has read my code and been confused.

This term is used in computer programing, usually to describe or label an affliction many programmers suffer when they learn of the ternary operator. This affliction causes overuse of the ternary operator, which results in difficult to read and maintain code.

Typically, a ternary operation in programming is a shorthand method for condensing if/else values that result in an assignment to a variable. Example:

This tends to happen a lot in JavaScript code, where developers like to be concise for bandwidth considerations:

// standard if/else
   b = true;
   b = false;
// a simple ternary
b = a===1 ? true : false;

It's easy to spot a ternariholic when you find nested ternary expressions:

// getting a little hard to follow
// Note: parenthetical enclosing is not necessary here but is added for clarity
b = a ? (a===1 ? true : false) : c;
// and diving into the mouth of madness, where we start to wonder two things:
// 1. is the this programmer a ternariholic?
// 2. is the intention even sane?
b = a ? (a===1 ? true : false) : (c ? (c === 1 ? true : false) : d);
No comments yet.
You must be logged in to post a comment.