Packages without packages
- To: mathgroup at smc.vnet.net
- Subject: [mg86836] Packages without packages
- From: AES <siegman at stanford.edu>
- Date: Sun, 23 Mar 2008 01:00:38 -0500 (EST)
- Organization: Stanford University
- References: <fro3a6$i8l$1@smc.vnet.net> <frqpnm$505$1@smc.vnet.net> <fs26nq$6r$1@smc.vnet.net>
In article <fs26nq$6r$1 at smc.vnet.net>, in the "Saving Packages" thread, "alexxx.magni at gmail.com" <alexxx.magni at gmail.com> wrote: > Yet I'd like to explain better what is my larger problem is: > to break down a big project in pieces, it is correct then to save big > chunks of code definitions as packages? In my musing on packages, I've been thinking that I tend to have a fair number of individual projects on different physical topics, which I keep in individual folders or directories, and each of which tends to have its own set of project-specific modules or packages. And, my packages in fact consist almost totally of just Module definitions, sometimes lengthy, which implement some complicated computational algorithm or create some plot or table generally specific to that project. So, why futz with the complexity of Mathematica's global package mechanism at all? How about a "packages without packages" approach. For each project, I typically have one or a few project notebooks which, essentially, explore physics questions and prepare reports or memos or documents that I file or send to others (and in which I may want to present a lot of graphic or tabular results, with a lot of associated commentary, but very little detailed code). So, why not associate with each project a ProjectModules.nb notebook which contains nothing but the definitions of any major or lengthy Modules or := formula definitions tht I use in that project's notebooks. This ProjectModules.nb notebook **can reside right in the folder for that project** -- in fact, it can be open all the time I'm working on any of the notebooks for that project, with its window minimized. If I decide I want to reformat a graphic that is created in one of those project notebooks by a certain Module, I can open ProjectModules.nb window, do the editing of that Module, and re-execute the whole notebook very quickly (it doesn't _do_ any work when re=executed; just redefines stuff). Shifting over to work on a different project? Just open the folder for that project; restart Mathematica to clear out all the sludge from the previous project; execute the ProjectModules.nb in that folder; and start on whatever other notebook(s) that use those modules. I'm not knocking that basic packages concept, for those who may need it. But for me, "packages without packages" may offer: 1) Modularity 2) Simplicity 3) I always know what's going on. 4) Freedom from cross-project confusion 5) Freedom from the complexities of the whole package system (and from Wolfram's compulsion to keep changing it) (and from their inability to document these changes usefully)