This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: I'm sorry, but this is unacceptable (union members and ctors)




mark-28 wrote:
> 
> I don't understand what is being requested. Have one structure with
> four fields, and another with two, and allow them to be used
> automatically interchangeably? How is this a good thing? How will
> this prevent the implementor from making a stupid mistake?
> 

Its less a question of making a stupid mistake, as code being intelligible
for whoever must work with it / pick it up quickly out of the blue. The more
intelligible (less convoluted) it is, the easier it is to quickly grasp what
is going on at the macroscopic as well as the microscopic levels. The way I
personally program, typically a comment generally only adds obscusification
to code which already more effeciently betrays its own function.

Also syntacticly, I think its bad form for a function to simply access a
data member directly / fudge its type. A function should imply that
something functional is happening (or could be happening -- in the case of
protected data / functionality)

Granted, often intelligibility can demand too much semantic overhead from
strict languages like c, but just as often perhaps, in just such a case, a
simple accommodation is plainly obvious.


-- 
View this message in context: http://www.nabble.com/I%27m-sorry%2C-but-this-is-unacceptable-%28union-members-and-ctors%29-tf3930964.html#a11337824
Sent from the gcc - Dev mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]