Hacker News new | ask | show | jobs
by TheTrotters 1801 days ago
In a vacuum real math symbols look better but they're virtually never used in practice and they mess up people's pattern recognition.

It's uncanny valley but for code.

2 comments

> they mess up people's pattern recognition

you have described perfectly the problem that I have when reading n0code written by programmers who are not mathematicians... my mind wants to read variables with multiple letters as products of each letter.

I find multi-letter variable names extremely old fasioned, as when math was written explicitly in latin before the advent of algeraic notation.

EDIT: an illustrative tweet of my concern: https://mobile.twitter.com/fermatslibrary/status/14109451739...

> I find multi-letter variable names extremely old fasioned

Sometimes I read things here on Hacker News that throw me so hard I leave the site for a month or two. Congratulations, this time it's your fault. Goodbye.

One-letter variables have all approximately the same physical size; this makes the “tokenization” step of reading a formula faster.

They are also less descriptive, and this makes the semantic interpretation more difficult.

Usually mathematicians read entire papers, or large excerpts, at a time. In this situation the semantic association symbols<->concepts is often made at the beginning of each section and reused for several formulas, making mathematical notation more effective.

Programmers instead often look at code in smaller fragments. They don’t have thesame level of contextual information readily available and so they often prefer to embed this information in variable names.

Add that programs are written mostly in ASCII, on a keyboard, with autocomplete, in a single typeface, and math by hand, on paper or blackboard, with much more graphic possibilities.

What can I say... glad to have helped you to boost your productivity ;)
>they mess up people's pattern recognition.

Quite the opposite. Verbose, "readable" code destroys pattern recognition.