Re:A toy DNS resolver
by inopinatus on Wednesday February 02, 2022 @12:29AM
(#30174092)
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.
Re:A toy DNS resolver
by philosopher1234 on Tuesday February 01, 2022 @11:33PM
(#30173738)
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.
Re:A toy DNS resolver
by catlifeonmars on Wednesday February 02, 2022 @12:37AM
(#30174144)
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.
Re:A toy DNS resolver
by philosopher1234 on Wednesday February 02, 2022 @01:16AM
(#30174415)
This is true of any defense ever made. Doesn’t say anything specific to this argument.
Re:A toy DNS resolver
by userbinator on Thursday February 03, 2022 @12:14AM
(#30188960)
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 ?/:.
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.