Best practice for using fields

Hi,
I seem to be using fields more now and want to follow the best practice.

Is it better to have a field for each item rather than a field containing multiple items? Are there any unintended consequences for having multiple items in a field?

Regards
Jon

Accessing them gets more complicated, depending on the structure of the field data

1 Like

Might it require more resources as well? (computing power)

My expirence suggests performace issues are rarely an issue and you can address them should they occur.

As a result the best approach is to build it that makes sense to you and others who need to know.

To choose between a field with a single value or a list can in part relate directly to singular or plural.

  • for example the field related-tiddler suggests a tiddler.
    • are you happy with only one?
  • related-tiddlers implies a list. You can have more than one named tiddlers.
  • then think what you field intends to achive and make your choice at a logical level.
    • multiple values has an overhead to start with but quickly makes it easier if you do have multiples.

Thus both come out the same effort in the longer run so make them as you imagin them. Its a lot more effort if you have to change it

One final trick if more than one item is to be allowed, is to treat the field as holding a filter, even if it is only a list of tiddlers initialy. Because you could use any filter in the field in the future like tags[] etc…

1 Like