Note that there are some explanatory texts on larger screens.

plurals
  1. POBest practice for structuring data over time
    primarykey
    data
    text
    <p>Hypothetically, if I am tracking the work of a colleague over time. What is the best way to structure my data? My example is entirely made up, but it's a programming question that has come up in practice a huge amount of times.</p> <p>My question is best illustrated with a simple example : </p> <p>You are hardcoding your colleagues work into three separate lists every day. Let's say list 1 is "What he/she needs to do". Let's say list 2 is "What he/she has done". And finally, list 3 is the date these values were recorded.</p> <p>All of the lists are cumulative, and can either increase or decrease over time.</p> <p>So, on day four list 1 would consist of 4 ints: {100, 97, 94, 101} - the integers representing the pieces of work left to be completed. On day four, list 2 would consist of 4 cumulative integer values : {0, 3, 3, 5} representing the work this colleague has done so far (each time they do a piece of work, you add one to the list). List 3 would consist of the dates (let's assume the program is ran once a day, so 01/01/2012, 02/01/2012 etc etc).</p> <p>Now, obviously using a list to store this data is poor practice - forget to input one piece of data and all of your data is corrupted and off by one. </p> <p>What would be the best practice in this case? How should the data be structured? In my head, it seems like a mapping from date to results would be good practice, would this be correct, and create a custom class to hold the "work done/ work to do" information?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload