Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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!!".


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.


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 :(




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: