Local storage vs list in variable

Hi, the title is strange, but the situation is as follows. I have an application in which I store a little over 20 variables. I wondered how it was better to do it. I tested two options:

  1. I create a list of data in one variable and each time I call information from the list.
  2. I save all the data in the local storage and then call them from there.
    Both methods work equally fast. I am currently opting for option 1 because it requires fewer blocks.
    In your opinion, which method is correct and which do you prefer?
1 Like

From experience using long long list can be problematic in the coding side but works out in the long run.

2 Likes

I would opt for a stored variable of type object.

With lists, you will have to remember the order of variable and where they are used for.

In the other hand an object is a set of pairs with key:value which makes retrieving it easier and revisiting the code after sometime more obvious.

2 Likes

I hadn’t thought about using an object. Really long lists are difficult to maintain :).

1 Like

I strongly suggest this method. I have a big ass app with a ton of lists. Some lists have 50 slots… that takes a lot of time to deal with that. An object with key:value pairs is the way to go

1 Like