At 2017-04-30T19:34:20-0400, James K. Lowden wrote: > On Fri, 28 Apr 2017 01:15:05 -0400 > "G. Branden Robinson" <g.branden.robin...@gmail.com> wrote: > > C adopted designated initializers, a sop to those who can't recall > > what order a struct's fields come in. > > I guess you're implying that designated initializers, while verbose, > are easier to use, even for aficionados of a terse language like C. > As it happens, my current work is in C, and I adopted C11 as a > baseline, partly so I could use them. > > With today's machines, the compiler can do more than was feasible in > 1978. I'd argue we have bigger structures now, too. Designated > initializers aren't so much a sop to the lazy as they are a gift of > clarity, because otherwise the programmer has to count structure > elements and supply any zeros preceding the elements to be > initialized. Designated initializers also support re-initialization of > existing structures, something that otherwise required error-prone > member-by-member assignment. > > All to say that at least one fan of short macro names finds explicit > structure initialization useful.
Lest I be misunderstood, even on a side point, and to assuage fears in the event I start submitting patches to, say, libgroff, I'm a big fan of designated initializers. I was indulging myself in a bit of snark; alas, the price I pay for that is being sometimes misunderstood. :-O Regards, Branden
signature.asc
Description: PGP signature