MathGroup Archive 2003

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

Search the Archive

Re: Opinions about the "Oneliners"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40649] Re: Opinions about the "Oneliners"
  • From: atelesforos at hotmail.com (Orestis Vantzos)
  • Date: Sat, 12 Apr 2003 03:09:16 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I'll second that...
IMHO oneliners are a result of the Mathematica language, not some holy
crusade that we have embarked upon. Once you realise that most
problems can indeed be solved with oneliners it is natural to seek
them out __plus__ they are almost always more efficient than any
Fortran-like construct.
In terms of comprehensibility, I think that the oneliners are not the
problem. If you don't understand the kind of operations that we are
routinely using in the oneliners (Fold, Outer, Tr, etc.) then
expanding the oneliner in a many-liner will not help much. In my
experience, when people complain about the oneliners, it is C or
Fortran they expect to see.

Orestis


Dr Bob <majort at cox-internet.com> wrote in message news:<b75o54$28p$1 at smc.vnet.net>...
> Doing it in one line isn't the point.
> 
> Do, While, and For are often the least efficient (slowest) way to do things 
> in terms of execution time.  We see this time after time in our function 
> wars.
> 
> Bobby
> 
> On Thu, 10 Apr 2003 03:42:06 -0400 (EDT), David Terr <dterr at wolfram.com> 
> wrote:
> 
> > nafod40 wrote:
> >
> >> Gerry Flanagan wrote:
> >>
> >>> Actually, this is a pretty serious problem. We've been trying to make 
> >>> Mathematica a standard language for our engineering firm, but I've 
> >>> struggled for years with developing good documentation standards. The 
> >>> problem is that I have a couple of people that can program in 
> >>> Mathematica style - very compact functional form, but the people that 
> >>> don't use Mathematica everyday can never parse how the functions work.
> >>>
> >>
> >> Ditto for us. The oneliners are clever tricks, but they are essentially 
> >> opaque. A thick one liner can take even a decent (by our standards) 
> >> Mathematica programmer far too long to understand.
> >>
> > I'll second that! During my 3 years at WRI, I've written essentially all 
> > my Mathematica program in C style, i.e. using If, For, and While loops, 
> > to make it look more like C. Very few of the functions I've written are 
> > just one line, though I'm sure some clever Mathematica programmers could 
> > make much of my code quite a bit shorter, perhaps turning many of my 
> > functions into "Oneliners".
> >
> >>
> >> I'm a big fan of using typography
> >>
> >>> (indenting and other visual aids) in programming, but Mathematica makes 
> >>> even those methods difficult. I'm tempted to ban prefix and postfix 
> >>> notation in packages because they can make for very opaque code.
> >>>
> >>
> >> Another roadblock to those methods is that math typesetting and things 
> >> like special fonts, font colors, and embedded comments play havoc with 
> >> Mathematica's package autogeneration capability. It's been that way 
> >> since version 3. I don't understand why they leave those bugs in.
> >>
> >>
> >
> >
> >
> >
> >


  • Prev by Date: RE: Weirdness with symbol Degree vis Units
  • Next by Date: Re: Weirdness with symbol Degree vis Units
  • Previous by thread: Re: Opinions about the "Oneliners"
  • Next by thread: Re: Re: Opinions about the "Oneliners"