zlacker

[parent] [thread] 3 comments
1. pflats+(OP)[view] [source] 2013-10-08 20:37:09
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.

replies(3): >>8_hour+t2 >>Jonnie+0O >>thinkp+0i1
2. 8_hour+t2[view] [source] 2013-10-08 21:03:09
>>pflats+(OP)
That makes sense; I'm not the target audience. It was just a little off-putting to see some code and think "Whoa! That reminds me of Perl golf!!".
3. Jonnie+0O[view] [source] 2013-10-09 12:21:51
>>pflats+(OP)
But why pick two letters, m and n, which are pronounced almost exactly the same way? That broke my brain so badly at uni on so many occasions, especially with non-native-speaking lecturers :(
4. thinkp+0i1[view] [source] 2013-10-09 17:39:29
>>pflats+(OP)
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]