R
R
Roman Sarvarov2020-09-22 09:34:16
Database design
Roman Sarvarov, 2020-09-22 09:34:16

Positive or negative field names?

There is a documents table. Some documents will need to be registered. Is it better to make the need_registration (bool) column and set it to true if document registration is necessary? Or make the skip_registration (bool) column and set it to false?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zexer, 2020-09-22
@megakor

It is more logical to make the need_registration column and set it to true if the document registration is necessary.
Registration of a document is essentially an action that needs or does not need to be performed. Accordingly, with this option, it becomes intuitive that if true, the action must be performed.
If done through skip_registration, then if true, the action will be "no registration", respectively, if the document is registered, the field will be false - the "skip registration" action does not need to be performed. This is some nonsense)

S
Stalker_RED, 2020-09-22
@Stalker_RED

There is no standard, there are only recommendations adopted in some frameworks or organizations.
I would call registration_required

N
noremorse_ru, 2020-09-22
@noremorse_ru

No difference in terms of performance. Logically, you need to put what will be repeated more often, i.e. will be the default value

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question