MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: WORKBENCH VS MATHEMATICA

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110338] Re: WORKBENCH VS MATHEMATICA
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sun, 13 Jun 2010 18:52:38 -0400 (EDT)

I don't think there is a technically preferred method but it is rather a
matter of personal preference. The exception might be if you were writing
code in other languages and incorporation it in an application, where
Workbench would probably be preferred. But I write everything in Mathematica
and don't know much about that kind of work. 

I view Workbench as primarily a tool for organizing and documenting a
Mathematica Application. The application might be a book, university
courseware, a research project, or just self study on some topic. It might
contain one or more packages, ancillary collections of notebooks,
documentation and guide pages to link it all together.

My own preferred method is to do the major development in regular
Mathematica, outside of Workbench, and then when some new routine is
perfected and tested, or some new notebook is finished, to move to Workbench
and incorporate them. This would consist mainly of copying the routine or
notebook in, writing a Function page for routines, and adding the links to
the guide pages.

In a deployed application, it's possible to add your own additional folders,
a Workbooks folder say, and put developmental and/or application notebooks
there. This is a good method for organizing your work because all your
notebooks that relate to the application are with the application. If you
update the application with Workbench and redeploy it, it will not overwrite
your Workbooks folder (provided you keep Workbooks out of the Workbench
files! Also, if you were to Uninstall you would lose the Workbooks because
it gets rid of the entire application.) So this is a method that is oriented
more toward the application material itself and less toward hard core,
nerdy, low-level code development.

You can do some code development or fix-up within Workbench. There are two
editors for looking at and editing code and each has its advantages. The
nice thing is that you can use both editors. The Workbench editor displays
package code within the Workbench window. Some of its features are that it
marks errors and warnings with little yellow bars and you can find the
locations quickly; if you hover the mouse over a routine name it displays
the usage message in a tooltip; if you select some symbol, then that symbol
is highlighted everywhere in the code; you can add debugging statements and
run the code. (However, I usually debug in regular Mathematica, back in the
Workbooks folder, by adding temporary Print statements.) You can also create
test files containing input statements and the correct output and run them
when changes are made.

The second editor, "System Editor", is the regular Mathematica editor for
package.m files. It displays outside of the Workbench window. Here the
package notebook can be structured to look something like a regular
Mathematica notebook with a Title, Sections, Text cells and Code cells. (Mac
users may have some difficulty getting this editor, within Workbench at
least. There is some Mac procedure to get the package.m files to open with
the correct editor, but I don't know the details. Check with WRI, or maybe
someone will explain on MathGroup.) Only the Code cells will be initialized
and appear in the package. You can, however, switch to Input Cells to edit
and then switch back. This is especially useful for usage messages. You can
also keep an old, inactive version of some routine as an Input cell for
reference. You can use Text cells for extended comments and description. So
both editors are convenient.

There is the hard nerdy computer science stuff, the kind of thing that the
WRI folks are doing and I would guess they do most of it in the Workbench
environment.

But most users will be more interested in their application material and
there Workbench can be used as an effective organizing and documentation
tool with most of the development work being done within regular
Mathematica.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  

 

From: J and B [mailto:noslowski at comcast.net] 

In writing code which is the preferred method, Work Bench or Mathematica?
 
In ether one, why do you use it vs. the other?



  • Prev by Date: Re: WORKBENCH VS MATHEMATICA
  • Next by Date: DiscretePlot
  • Previous by thread: Re: WORKBENCH VS MATHEMATICA
  • Next by thread: Re: WORKBENCH VS MATHEMATICA