On 01/22/2014 07:38 PM, S. Dale Morrey wrote: > Also yes ->nVersion is a pointer to the int nVersion contained in pStart, > there are no other shiny bits involved. > Honestly if I were coding this from scratch I would have made nVersion > private and added a method getVersion(); That's probably my Java > experience talking, but it seems like better OO practice in my mind.
But if we're talking about a public, versioned, protocol, that's defined in the header file, then there's really no need to add a getter and setter, since the underlying implementation is never going to change. Sounds to me like you are dealing with what is essentially a well-defined protocol (publicly defined in the .h file), though it's probably not versioned. And the code you posted doesn't say it is a class, either. It could just as easy be a struct, as is common. I know there's money to be made in Java, but things like getters and setters make me want to run screaming from it. Right back to comfortable, flexible, expressive, and slow Python. /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
