Hacker News new | ask | show | jobs
by redcat7 1935 days ago
I love academics. They can post shitty code full of single letter variables etc and still get the applause for it, not to mention the paycheck :D
3 comments

This is not shitty code, single letter names have their place, and are absolutely fine here.
I like Golang's convention for names - names should get longer and more expressive the wider their use is across the code. Single letter names for loop variables, two or three letter names to refer to the current struct in methods, but expressive struct and function names.
academic is about computer science not computer programming. 2 very different things, their "shitty code" is often "good computer science code" and just like it's fine to have single letter variables when reading mathematics, it's the same when reading computer science code. the idea is to get knowledge across which can then be expressed clearly by computer programmers.
screw this shit
Regarding this example, which variable could do with being longer? It seemed fine to me!