views:

141

answers:

4

I have 'Service' table and the following column description as below

  1. Is User Verification Required for service ?
  2. Is User's Email Activation Required for the service ?
  3. Is User's Mobile Activation required for the service ?

I Hesitate in naming these columns as below

IsVerificationRequired
IsEmailActivationRequired
IsMobileActivationRequired

or

RequireVerification
RequireEmailActivation
RequireMobileActivation

I can't determined which way is the best .So, Is one of the above suggested name is the best or is there other better ones ?

+2  A: 

I would choose VerificationRequired, EmailActivationRequired etc.

Database is the snapshot of the state, so the above said column names goes better over the ones you have mentioned in my opinion.

Srivatsa Katta
I agree. The column names in the form of a question seem like overkill. It would be like naming FirstName and LastName columns "WhatIsTheFirstName" and "WhatIsTheLastName". Which is clearly silly.
MJB
but i think in some case such this that need either true or false question is so readable that determine true or false not any other value
Space Cracker
@MJB: Not silly. You could also have DateVerificationRequired ! I often replace Boolean fields by date fields if that adds extra information (and of course if the value is subject to change). In that case a Null indicates the condition is not met (yet).
iDevlop
+7  A: 

I would (and do) use "IsVerificationRequired"

I try to add some meaning to my column names so it's obvious (ValueDate, InsertedDateTime, IsActive, HazCheezBurger, ProductName etc). "Isxxxx" implies yes/no for example without thinking and you only have 2 states unlike "ProductName".

gbn
+1 - I take the same approach
AdaTheDev
Shouldn't that be HazCheezBurger? :-)
Dan F
+1, Isxxx indicates clearly it's a boolean.
iDevlop
@DanF: it's LastCheersBurger, and it shows it was a date :)
iDevlop
+4  A: 

Run with the Is variants, or at the very least swap the Require to Requires. Booleans should be phrased as questions. Is, Can, Has, Should, they're all good prefixes for Boolean functions/columns. See 1370840 for more arguments on this

Dan F
A: 

I would go for the one that fits more the syntax you are using in your current project. Either one is fine since they describe what the variable contains, the only thing you need to worry about is that you keep the same naming standard for all your project. If you haven't decide any naming standard for your project yet, the first one would be better since it is what is closer of the Java Bean naming standard which is something that a lot of developer are used to.

HoLyVieR