← Back to team overview

drizzle-discuss team mailing list archive

Re: Enum style, odds and ends


Brian Aker wrote:
> Hi!
> I don't know that we reached consensus on enum. What style do we want?
> State 
> state_t
> state

I don't have a strong opinion here. I prefer not _t, because this is C++
not C, but consistency across projects is also nice.

> I favor the second because that is what we are moving toward in the other projects. We don't have a strong style on struct either for that matter. Should we name them as classes? Or state_st ? 

I do feel strongly that we should not give structs a _st suffix. In C++
structs are nothing more than classes whose members default to public
instead of defaulting to private. I do not believe we need to give them
a special naming convention.

> In general we should almost never have them, so I don't worry about them too much. 
> One additional things.  We don't use a lot of :
> class Foor {
>   class Bar {}
> }
> I think using them for classes that are only used internally to another class would be a good idea (say for instance... how  StorageEngine has a set of classes it uses for its foreach() calls to find definitions).

I'm fine with that. Although for the iterator function objects they
should probably be private.