MathGroup Archive 2003

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

Search the Archive

Re: Opinions about the "Oneliners"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40321] Re: [mg40315] Opinions about the "Oneliners"
  • From: Kirk Reinholtz <kirk.reinholtz at jpl.nasa.gov>
  • Date: Tue, 1 Apr 2003 04:51:15 -0500 (EST)
  • References: <200303310901.EAA21722@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

As to "... no comments ...".  I believe this might trace to a Mathematica culture
that the code itself is a direct statement of what it does, and so in
most cases comments wouldn't really clarify things unless you can't read
the Mathematica directly.  Wolfram himself mentions this in NKS, and the
mathematica book says it someplace too, I believe.

So, the only comments you'd tend to find is where the behavior of the
algorithm wasn't clear even when the Mathematica code was completely understood. 
One liners tend to not have that property.

For example, you wouldn't find a comment like "Iterate over the list
selecting each element greater than 5 then sum the selected elements" in
the Mathematica culture.

Oliver Friedrich wrote:
> 
> Hallo dear community,
> 
> I don't know whether this topic has been discussed ever since before.
> 
> I like those socalled "Oneliners" to solve this or that problem. It shows
> up, how elegant and effective the Mathematica language can be.
> 
> But to be honest: Isn't it a torture trying to understand the "how does it
> work" of a oneliner written by some else?
> 
> Is it useful to use //TreeForm to visualize the inner structure of a
> oneliner (where is the "inner beginning")
> 
> The vast majority of oneliners presented here lack on comments. Despite of
> the wonderful constructs, is this good programming style?
> 
> I'm looking forward to the next oneliner !
> 
> Oliver Friedrich


  • Prev by Date: Re: Re: Need a nice way to do this
  • Next by Date: AW: Need a nice way to do this
  • Previous by thread: Re: Re: Need a nice way to do this
  • Next by thread: Re: Opinions about the "Oneliners"