MathGroup Archive 2002

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

Search the Archive

Re: OOP in Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37629] Re: [mg37570] OOP in Mathematica
  • From: "Hermann Schmitt" <schmitther at netcologne.de>
  • Date: Wed, 6 Nov 2002 06:59:03 -0500 (EST)
  • References: <A06E01A4-F12D-11D6-ADE7-00039311C1CC@tuins.ac.jp>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
I think, when Mathematica was created, OO was not yet existent in
programming languages. I am astonished about the OO-like features, which are
built into Mathematica despite of this. Into older languages OO must be
built after they were created, and this is also done.
In my opinion it is not the main criterion, that a program runs fast in that
programming language. If this was the case you should program in assembler
language. The fact, that Mathematica is an interpreted language shows, that
other considerations were prominent, when the language was designed.
Compiled languages are faster.
The main criterion is in my opion is, that the program can be created easily
and yet more important, that it can be easily understood and modified
afterwards.
I think, Mathematica is well suited, to integrate an OO-System.
Hermann Schmitt.
----- Original Message -----
From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
To: mathgroup at smc.vnet.net
Subject: [mg37629] Re: [mg37570] OOP in Mathematica


> Well, it simply means that I do not agree with some of the things you
> seem to think, that's all. Basically it amounts to the fact that
> Mathematica was not meant to be used as an OO-langauge by Wolfram and
> was deliberately not constructed in this way, unlike those languages
> that are designed from ground up to be OO. So when you write in
> OO-style you are simply  dressing-up Mathematica language in a foreign
> paradigm and usually end up with less efficient code. Unlike what you
> seem to think, I think there is a big difference between built-in
> abilities and those added by users, and it shows itself in performance.
> In fact being aware of this difference is the most important factor in
> efficient Mathematica programming. This distinguishes Mathematica from
> most other languages.
> I don't really want to enter into any arguments which after all are
> only a matter of opinion,  but I would propose the following
> "objective" test of "good" OO package in Mathematica. The test is that
> a proficient user cannot write easily a more efficient and equivalent
> code without the package. So far I have not seen any "OOP" in
> Mathematica that does anything in a way that I cannot do equally or
> (usually) more efficiently myself without it. Unless an OOP package can
> satisfy this requirement it will be used only by users who learned
> their programming on other languages and have not adapted their style
> to Mathematica.
> By the way, I have a good reason to believe that Wolfram will introduce
> some OOP into Mathematica, that will actually enhance rather than
> reduce performance. I will then think of it as real OOP rather than
> pseudo-OOP.
>
> Regards
>
> Andrzej Kozlowski
>
>
>
> On Wednesday, November 6, 2002, at 04:54 AM, Hermann Schmitt wrote:
>
> > Hello,
> > what do you mean with "pseudo"-OOP?
> > Hermann Schmitt
> > ----- Original Message -----
> > From: "Andrzej Kozlowski" <andrzej at tuins.ac.jp>
To: mathgroup at smc.vnet.net
> > To: <mathgroup at smc.vnet.net>
> > Sent: Tuesday, November 05, 2002 11:00 AM
> > Subject: [mg37629] [mg37570] OOP in Mathematica
> >
> >
> >> Various have people have sent interesting examples of OO programming
> >> in
> >> Mathematica, as a proof that "it can be done". However, let me clarify
> >> one possible confusion:  I for one have never doubted that "it can be
> >> done". (In fact I have occasionally tried it myself). The more
> >> doubtful
> >> issue is "is it worth doing?", or "is it really the best way to
> >> program
> >> in Mathematica?".  I can imagine that OOP may be  useful for dealing
> >> with large structures and there may be (as I have been told) some
> >> performance advantages in introducing some OOP into Mathemaitca. But
> >> none the examples I have seen here seems to me to gain much from
> >> pseudo-OOP, which is in fact also the trouble with Maeder's package. I
> >> have seen a couple fairly large project written using it (one is the
> >> Object-Oriented Graph Theory in Chapter III of Grey's "Mastering
> >> Mathematica"), but all of them can be programmed with no more effort
> >> using the natural Mathematica "functional-pattern based" style.
> >>
> >> Andrzej Kozlowski
> >>
> >>
> >
> >
> >
> Andrzej Kozlowski
> Yokohama, Japan
> http://www.mimuw.edu.pl/~akoz/
> http://platon.c.u-tokyo.ac.jp/andrzej/
>



  • Prev by Date: Re: OOP in Mathematica
  • Next by Date: Re: making a block diagonal matrix (2)
  • Previous by thread: Re: OOP in Mathematica
  • Next by thread: Re: OOP in Mathematica