Re: [vox] [OT] unions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox] [OT] unions
I think that unions had a purpose in the past, but government
regulation has made them less and less useful. Normal everyday
structures provide most members with enough portable benefits
and security that I don't understand why this outdated
feature has not been banned! :-)
Joel
On Fri, Aug 24, 2001 at 02:48:38PM -0700, Jeff Newmiller wrote:
> On Fri, 24 Aug 2001, Gabriel Rosa wrote:
>
> > On Fri, 24 Aug 2001, Peter Jay Salzman wrote:
> >
> > > btw, in all my years of coding C, i just used a union for the first time.
> > > i feel like celebrating. :) also wrote my first lex program. now the
> > > big trick will be writing the bison companion. oi vey.
> > >
> >
> > I can think of many uses for them, but none in projects that I want to
> > undertake. Conceptually, they are very cool, but as one of my cs profs said
> > (loosely), "In 15 years of C, I've seen 1 person use a union for a good
> > reason".
>
> In 15 years, I have used them a couple of times "for a good reason".
> Most interesting one was in a menu datastructure in an embedded C program.
> Kept data requirements small and allowed "polymorphic" data handling. In
> other cases, I setup various implementation-specific data format
> converters with them.
>
> But yes, good uses are rare.
>
> > Congrats! ;)
>
> Seconded ... and we won't even ask if your reasons were pure. :)
>
> ---------------------------------------------------------------------------
> Jeff Newmiller The ..... ..... Go Live...
[...]
|