Hacker News new | ask | show | jobs
by zX41ZdbW 1622 days ago
Here is my favorite: https://github.com/ClickHouse/ClickHouse/blob/master/utils/c...

"Too many exclamation marks"

2 comments

I wonder how they picked three as too many. Why not two?

> Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count, neither count thou two, excepting that thou then proceed to three. Five is right out.

Maybe because of the use of the "double bang" pattern to convert a value to boolean:

    !!41 === true
    !!0  === false
`!!thing` is a fairly common JS idiom for "I have a truthy/falsy thing and I want true or false."
Two really does seem too many. I worry about these times when any passing coder can ni-gate at will.
This is the obvious answer.
I enjoy seeing a nice shell script. This one is easy to follow and is consistently formatted.