MathGroup Archive 2002

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

Search the Archive

Re: Re: Re: OO in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37781] Re: [mg37739] Re: [mg37635] Re: OO in Mathematica
  • From: "Steven T. Hatton" <hattons at globalsymmetry.com>
  • Date: Wed, 13 Nov 2002 01:10:42 -0500 (EST)
  • References: <4EDE40BF-ECCD-11D6-B0A7-00039311C1CC@tuins.ac.jp> <200211071141.GAA00777@smc.vnet.net> <200211101038.FAA11818@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Sunday 10 November 2002 05:38 am, Hermann Schmitt wrote:

> ----- Original Message -----
> From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
To: mathgroup at smc.vnet.net
> To: mathgroup at smc.vnet.net
> Subject: [mg37781] [mg37739] [mg37635] Re: OO in Mathematica
>
> > Hi,
> >
> > you are right, I have never written a Mathematica "program"
> > and I don't know what is can be. Since there is no "program"
> > it can't have any structure. You can have functions but I have
> > never written a function with more than ca 30 statements.
> > There is no reason to "structure" a Mathematica function that
> > has typical 5--10 statements.
> >
> > It seems that larger packages work perfectly right
> > without any object oriented extension -- how can this
> > happen ?
> >
> > And yes I mean functional programming when I say
> > "functional programming". Every
> > real functional/logic programming language
> > has an assigment. The assigment is not needed
> > but it save some computation time.  Mathematica
> > has also functions like While[] only for
> > efficiency.
> >
> > Regards
> >   Jens
> >
> > Hermann Schmitt wrote:
> > > Hello,
> > > you must differentiate between instructions and the structuring of
>
> programs.
>
> > > If you write a small program the structure of the program is no issue.
>
> But I
>
> > > think, that Mathematica is one of the best programming languages, you
>
> can
>
> > > also program larger programs/applications with Mathematica. Then the
> > > structuring of the program/the applications is an issue. You ignore the
> > > problems of structuring.
> > > Additionally, your usage of the notion "functional programming" is
>
> wrong. If
>
> > > you read in the literature, you will see, that functional programming
> > > is programming only with functions and expressions and without
> > > variables
>
> and
>
> > > without the assignement of values to variables. I think, you  can
>
> program in
>
> > > this way in Mathematica, but I do not think, that you mean this.
> > > Hermann
[fixed evil top posting ;-)]
(There's an RFC on this, BTW)
> Hello,
> you write below, that you have never written a function with more tha ca.
> 30 statements and a function has typical 5-10 statements.
> But in the next section you write about packages. That is, there is
> something to be designed beyond the single function!
> You do not see the forest because of the many trees!
>
> Hermann Schmitt

I've been off list for the past couple weeks.  I'm glad to see this discussion 
of OO is continuing.  It's hard to say how much such a feature would be used 
in Mathematica.  What I've been attempting lately would benefit greatly from 
OO.  Dr. Mäder's Classes don't quite provide the kind of OO support I would 
like.

The real question is how many people would want to do things such as creating 
a beam object, give it certain attributes such as flexibility; rotational 
deformation characteristic - resistance to torque, recovery from twisting 
deformations; tensile strength etc., etc. and try to assemble a building out 
if these in virtual space?

The fact that people *can* write fairly large programs without good OO support 
doesn't mean they would not benefit from OO.  My passion is 3D visualization 
of physical systems evolving over time.  For such applications, OOP is 
invaluable.

There already are many OO-like features in Mathematica, such as operator 
overloading, polymorphism, etc.  What it lacks is the overall, conscious, OO 
support for classes,  inheritance, scoping, (some) type checking, etc.  A 
point some people seem to be overlooking in this discussion is that one man's 
object is often another man's data element.  There is no inherent 
contradiction between functional programming, and OOP, as I understand these 
terms.  Objects can be used as data in functional routines, and functional 
routines can be used to implement methods in objects.  Functions could be 
designed as objects with the ability to change behavior by changing member 
methods.

My limited understanding tells me that Mathematica *is* object oriented at the 
fundamental level.  That is, everything is made of expressions, which are 
actually either atoms, or lists of atoms.  The atoms themselves are simply 
named data with accessor methods.

Here's an example of something I wrote using a very OO approach in Java.

http://public.globalsymmetry.com/projects/math-3d/living-basis.html

Java3D has it's idiosyncracies, but I find, for graphics such as the Living 
Basis applet, Java 3D is easier to work with.  I suspect that good OO support 
in Mathematica would tip the scale in the other direction.  This application 
is the kind of thing that got me interested in Mathematica.  I really believe 
things such as this could be accomplished with Mathematica, and probably done 
better in many ways, than in Java 3D.  Perhaps my understanding of 
Mathematica is just too limited, and such applications are easy to create 
with the current product.  I have to admit that I have more Java experience 
than Mathematica experience.  OTOH, I have no idea how I would accomplish the 
same thing without OOP.

-- 
STH
Hatton's Law: 
"There is only One inviolable Law."



  • Prev by Date: RE: Literate Programming (Was: Comments are KILLING me)
  • Next by Date: denavit hartenburg parameters
  • Previous by thread: Re: Re: OO in Mathematica
  • Next by thread: Re: OO in Mathematica