Should we store generated files?

Unfortunately, the answer isn’t as simple as yes or no.

I suggest asking yourselves a few questions to help you determine whether it makes sense to store the generated files/resources.

Does storing these files/resources hurt you or your team in any way?

Are you running low on storage space because of these files?  Often the sheer number of these resources can become unmanageable, especially when you start looking at the space they are consuming in source control.

Does it take extra effort to actually store these resources?  If your team needs to go through extra steps to ensure that these items are being stored, they may be a candidate for dropping.

Does the existence of these files confuse people?  When I first started working with React.js, we stored both the source and the generated files.  I didn’t know what the difference was, or where I should be making changes.

Does it take longer to store or retrieve files because of the number/size of these extra files?  This may be hard to discern.  One way to get a feel for this is to simply look at the amount of storage dedicated to these temporary/generated files compared to the rest of the files.  If it seems a large portion is generated files, perhaps you could try removing them from the storage (maybe in a test location).

Are they easily reproduced?

Do you have an automated way to regenerate these files for individual developers? Ideally, the answer is yes (or at least nearly automated).  This could include a step in the build process (that you execute locally when you make changes, or is kicked off auto-magically), or a process that is waiting in the background for someone to make

Does reproducing them happen quickly? If the answer is no, then it might make sense to store these files.  If the files need to be regenerated often, though, even though the process takes time, it might make sense to not store them, as the stored files will be of little to no value.  If this is the case, then I would invest some time in ways to speed up the generation process, or remove the need for the files all together.

Can an individual reproduce them on his/her machine?  Sometimes files need to be generated on a machine with a certain setup (OS, applications, etc) and there are only a few of those places available.  If this is the case, then it might make sense to store the files, especially if they don’t need to be reproduced often.

Do the files need to be reproduced often?

If you need to reproduce the files often, because you are changing inputs, or changing environments, then you probably don’t want to store them.  Storing them is buying you very little in this case, since you will likely reproduce them and overwrite what was previously there.

 

Advertisements