Suppose that an application needs to be configured specifically for a user's system. e.g. the application needs to be told the location of certain data directories. What is the best way to provide this possibility to the user, so that the user doesn't have to enter this information every time they load the package?
I can name two ways off the top of my head:
The second approach seems cleaner to me (since it does not involve user's interaction with the internal state of your application), particularly when there are many properties which you'd like to make user - configurable.
|show 1 more comment|
At the moment, we ask users to set a certain variable in their init.m file, and the application then uses this variable. i.e.
Since this symbol is set first in the user's init.m file, before the application is loaded, it is created in the Global context. The application then refers to this variable as Global