Re: A Question About Directive
- To: mathgroup at smc.vnet.net
- Subject: [mg111298] Re: A Question About Directive
- From: Brett Champion <brettc at wolfram.com>
- Date: Tue, 27 Jul 2010 04:14:54 -0400 (EDT)
On Jul 26, 2010, at 5:38 AM, Kevin J. McCann wrote:
> However, is Directive[Red,AbsoluteThickness[2]] really more readable
> than {{Red,AbsoluteThickness[2]}}? I don't think so. Again, this seems
> like very little, even if you prefer the former, for a new function
> to do.
>
It may not make a big difference for PlotStyle, but within some of the
newer options it does. For example, ChartStyle can use one more level
of grouping than PlotStyle, so you could have things like
{{{Red,Thick},...}}. In MeshShading you can get arbitrarily deep,
depending on the number of mesh functions you have.
As a developer, it is *very* convenient to not have distinguish List-
as-a-set and List-as-a-combination in the code. It means that I can
make decisions on a more local scale without needing to keep
information about what level I'm at.
As for ambiguity, consider that *for ages* the documented and
implemented behaviors of PlotStyle did not agree, at least for some
functions.
According to the old documentation [http://reference.wolfram.com/legacy/v4/RefGuide/PlotStyle.html
]
Plot[{x, -x}, {x, 0, 10}, PlotStyle -> {Thickness[0.02],Hue[1]}]
should have behaved as
Plot[{x, -x}, {x, 0, 10}, PlotStyle -> {{Thickness[0.02],Hue[1]}}]
instead of as
Plot[{x, -x}, {x, 0, 10}, PlotStyle -> {{Thickness[0.02]},{Hue[1]}}]
Brett
> Kevin
>
> AES wrote:
>> In article <i2eadd$q1l$1 at smc.vnet.net>,
>> Murray Eisenberg <murray at math.umass.edu> wrote:
>>
>>> Fewer keystrokes is not the sole metric for simplicity! Code
>>> readability
>>> is another.
>>
>> Agreed!
>>
>> Wasn't APL the classic example of a language with near-minimum
>> keystrokes, near-maximum unreadability? -- such that APL programs
>> were
>> sometimes characterized as "write once, read never".
>>
>