Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!OWENSJ%VTVM1.BITNET@CUNYVM.CUNY.EDU From: OWENSJ%VTVM1.BITNET@CUNYVM.CUNY.EDU (John Owens) Newsgroups: comp.lang.c Subject: Re: A bad design decision early on in ANSI C. Message-ID: <11034@brl-adm.ARPA> Date: 29 Dec 87 19:40:10 GMT Sender: news@brl-adm.ARPA Lines: 36 >I would like to suggest removing a "feature" from 'C'. > >Structure assignment/passing. > >Unless you're going to go all the way and allow structures to be fully first >class objects (and presumably provide a way to overload operators so you can >do this meaningfully), it just adds confusion. I disagree. I use structure assignment quite often; it's definitely a useful abstraction. I think that pa[i]->xyz = input_structure is much clearer than either bcopy(&pa[i]->xyz,&input_structure,sizeof(input_structure)); which requires quite a bit of visual decoding (and please, no flames if I have arguments in the wrong order), or pa[i]->xyz.ab_next = input_structure.ab_next; pa[i]->xyz.ab_count= input_structure.ab_count; pa[i]->xyz.ab_flag = input_structure.ab_flag; pa[i]->xyz.ab_name = input_structure.ab_name; pa[i]->xyz.ab_used = input_structure.ab_used; which doesn't make it obvious that all fields are being copied, is prone to typing errors, and gets even messier if any of the members are structures themselves.... Besides, I don't think this was introduced in ANSI C - it certainly exists in a number of non-ANSI C compilers I've used. -John Owens +1 703 961 7827 Virginia Tech Communications Network Services OWENSJ@VTVM1.CC.VT.EDU OWENSJ@VTVM1.BITNET