DEV Community

Discussion on: Some cool JavaScript Shorthand that will make your code cleaner than your peer's

Collapse
matt profile image
Matt seymour

I cannot help but think the author has confused "clean code" with shortest code.

If anyone on my team wrote the "tenary example" I would give them a serious talking too. Why?
Code is generally written once and read many times. The focus should never be on the shortest code you can write but instead on the most readable code you can write. Even if that means the code is 20% longer than a shorter solution.

Collapse
jonrandy profile image
Jon Randy

'Readable' is purely subjective - depends upon the "reading level" of the reader. That said, nested conditional operators are not great