Hacker News new | ask | show | jobs
by Thaxll 1596 days ago
No Safe navigator: require 4 lines of code

No ternary support: require 6 lines of code

I'm glad Go does not have those, it makes the code less readable. It's only useful for simple operation and very often chained and abused.

3 comments

I very nearly got this ternary delight into FreeBSD src:

    if ((Lflag ? chown : lchown)(p->fts_accpath, s->st_uid, -1))
            (void)printf(" not modified: %s\n",
                strerror(errno));
which relies on the identical signature of chown(2) and lchown(2) syscalls.
This reminds me of the posts from 15 years ago saying why not having clipboard on iPhone was better.
Your point being that there’s no such thing as features that are better left out? Hard to believe
My point is that people develop attachment to things they own and use, and it's harder to be objective.
Well, obviously. GP used the phrase “compact and pretty”. It’s a bit of a stretch to interpret that as an objective statement. The charitable interpretation is that GP meant it to be subjective.

Edit: I got confused which post you were replying to. My apologies.

This is true of any defense ever made. Doesn’t say anything specific to this argument.
I really don't understand the hate that the ternary operator gets. If you know how to read if/else, you know how to read ?/:.