DEV Community

Discussion on: Your thoughts on Creating a New User

Collapse
 
jochemstoel profile image
Jochem Stoel

I would like to suggest that in stead of is_active, you call this property of user just active. (Boolean) this is more correct for many reasons.

Collapse
 
dmfay profile image
Dian Fay

What are those reasons? I find is_* clear for boolean fields since it makes it easy to identify them as answering a yes-or-no question, and where naming things isn't about clarity it's really down to taste.

Thread Thread
 
jochemstoel profile image
Jochem Stoel

The word is is redundant.
User.active = true
Why would you add it? You can tell that it is yes/no by the field/property type being Boolean. It's like putting 'equals' in your property name.

Thread Thread
 
dmfay profile image
Dian Fay • Edited

It's not always obvious that something is a boolean unless you're looking at a table or class definition. Redundancy isn't universally evil: here it means you don't have to look up the type if you're just looking at usage.

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
jessachandler profile image
Jess Chandler

thanks for your thoughts. I'll have to look at the naming conventions.