zlacker

[return to "The Sierpinski triangle page to end most Sierpinski triangle pages"]
1. 8_hour+0n[view] [source] 2013-10-08 20:16:35
>>pr_fan+(OP)
Is is just me or is the code source really hard to understand? It's cool that you can represent such complex shapes with just a few lines of code in Mathmatica, but without comments and with all the single letter variables, it's hard for me to follow what's going on.
◧◩
2. pflats+gp[view] [source] 2013-10-08 20:37:09
>>8_hour+0n
I agree, but do realize this is written for a mathematical audience, not a CS audience. It's reductive, but it's not that reductive to your average math major/grad student.

Code by/for mathematicians is particularly ugly to a professional programmer. There is significant historical (pencil & paper) precedent for what single-letter variables represent in a given context. For a mathematician, ConstantArray[0, {m,n}] reads more cleanly than ConstantArray[0, {cols,rows}].

Similarly, seeing variables like p1, p2, p3 is off-putting to me as a programmer, but I still immediately recognize them as 3 arbitrary points in a triangle.

◧◩◪
3. thinkp+gH1[view] [source] 2013-10-09 17:39:29
>>pflats+gp
This is one of the annoying things about Haskell code -- since many Haskell programmers come from math backgrounds, they tend to use very short variables, often one letter or a letter and a number, where a programmer would use a descriptive variable. Perhaps more annoyingly, as a result of this lineage, it's become part of the convention, so even those who come from a non-math background tend to use short, mathy variable names.
[go to top]