Re: Illumination or obfuscation?
- To: mathgroup at smc.vnet.net
- Subject: [mg43974] Re: [mg43943] Illumination or obfuscation?
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 16 Oct 2003 04:16:07 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Wednesday, October 15, 2003, at 05:59 PM, Steven T. Hatton wrote:
> To an experienced Mathematica user, is the following snippet clear,
> and easy
> to understand, or simply an exercise in obfuscation? Assume I already
> have
> px,py and m[] lying around.
>
> px = {1, 0};
> py = {0, 1};
>
> m[th_] := {{Cos[th], Sin[th]}, {-Sin[th], Cos[th]}}
>
> crossPoint[p_, th_:0, L_:0.5] :=
> Arrow[##,HeadLength -> 0.015]&@@#&/@(p+#.m[th]&/@{-#, #}&/@(L{px,
> py}))
>
>
>
Just a typical piece of functional programming. Feels great when you
have just written it but if you have to read someone else's code ... I
would recommend finding out somehow what it is meant to do and writing
it yourself. To be fair, the same is true of many formal mathematical
proofs.
Andrzej Kozlowski
Yokohama, Japan
http://www.mimuw.edu.pl/~akoz/
http://platon.c.u-tokyo.ac.jp/andrzej/