From: AES on 25 Jul 2010 02:00 In article <i2eadd$q1l$1(a)smc.vnet.net>, Murray Eisenberg <murray(a)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".
From: Mark McClure on 26 Jul 2010 06:57 On Fri, Jul 23, 2010 at 7:09 AM, Kevin J. McCann <Kevin.McCann(a)umbc.edu> wrote: > I'll agree that your example with the use of the Inner product is a clever > way to do that, but isn't this way more readable? > > Graphics[{ > Red,PointSize[Large],Point[{0,0}], > Blue,PointSize[Medium],Point[{1,0}] > }, > AspectRatio->1/10] Certainly, I'm not suggesting that one should use Inner and Directive to place a couple of differently colored and sized dots in a picture! I do a fair amount of graphics programming and, in that context, it can be convenient to have a head that indicates Graphics directives. Here's another example: DeleteCases[Graphics[ {Directive[Red], Point[{0, 0}]}], _Directive, Infinity] This is a long winded way to create a single black dot. While not the most efficient way to do it, this code indicates the kind of thing that one might do if one always enclosed directives in the Directive head. Mark
From: Kevin J. McCann on 26 Jul 2010 07:14 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. Kevin AES wrote: > In article <i2eadd$q1l$1(a)smc.vnet.net>, > Murray Eisenberg <murray(a)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". >
From: Brett Champion on 27 Jul 2010 04:14 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(a)smc.vnet.net>, >> Murray Eisenberg <murray(a)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". >> >
First
|
Prev
|
Pages: 1 2 3 4 Prev: Problems with Workbench Debugger Breakpoints Next: Multiple packages in a single application |