Why use defaults/preferences/*.js vs setting Firefox Add-on defaults in JavaScript?
<p>The more I think about it, I wonder why should anyone bother to use the defaults/preferences/*.js file to set defaults, versus setting the defaults in JavaScript?</p>

<p>I am doing work on an older XUL/Overlay based add-on created by someone else, which actually uses a prefs.js file in addition to setting all the defaults in the JavaScript (in case the prefs.js failed for some inexplicable reason?), which essentially makes all the preferences into user-prefs directly after installation.  This confused me at first, as the defaults were showing up as modified (user-set) when looking at the prefs in <code>about:config</code>.  Then I realized it was unconditionally setting some of the defaults (very large strings).</p>

<p>So I realized, not only do I maintain the same prefs in 3 locations (prefs.js, interface and content scripts), but the prefs.js file is largely redundant, which seems to add additional maintenance for no reason.  This just seems silly, and I am looking for a better way, to just store prefs and manage them in one location (which probably is why the prefs.js should be used exclusively).</p>

<p>Now, I realize, this question has the potential to be flagged as an "opinion", and may or may not have a specific "right" answer.  But I think it is a valid question, and I would like to learn more about the pros and cons of using a prefs.js file, versus setting all prefs during initialization in a shared JS code.  Are there any performance concerns, or objective list of criteria that I could use to make this determination?  Is it possible that the prefs.js mechanism would ever fail?  Is it safe to assume it never will fail?  Was it more prone to failure back in the FF 1.0-3.5 days?</p>