Re: Consensus on getter conventions?



-> I'd like to propose that we go with the convention of naming functions
-> that return references to internal data *_peek_* and naming functions
-> that allocate new memory *_get_*.

	This would result in far more *_peek_* functions in the library
than *_get_* functions, would it not?

	In the past, we've used *_get_* for most everything, right?
(That's not rhetorical, I'm really asking)

	It seems to me that we would break less existing code, and be more
like existing conventions (most notably JavaBeans) if we used *_get_* to
get references and something else for newly-allocated references (maybe
*_copy_*, since we're getting a newly allocated copy of what's in object)

	Question: Does Qt have a convention for this?  What about Motif?
MS-Windows/Mac?


--Derek Simkowiak






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]