7 ms·
Every source code file is a story. A story with characters, relationships between them, and how the characters behave towards one another. Humans are hardwired
by resf 9y ago
Every source code file is a story. A story with characters, relationships between them, and how the characters behave towards one another. Humans are hardwired to understand the world (and by extension computers) in terms of stories.
The way that programming languages allow us to write these stories is by giving us the opportunity to name things. Naming transforms code from a dumb sequence of instructions, to something that can be understood.
I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster.
- yorwba 9y ago> I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster. If you are referring to the use of non-alphanumeric symbols, then I wonder whether you believe that calling the monadic bind bind instead of >>= would really make things clearer? Sure, one of them looks like a word that already exists in English, so it might be marginally easier to remember; but it has nothing to do with the binding you do with a rope, so its familiar appearance is actually misleading. Personally, I believe you should use names that are already part of your vocabulary (even symbolic ones like +), or combine existing vocabulary items into a description (even mixing English and symbols, as in number->string), or make up your own arbitrary words or symbols, so long as the end result is internally consistent.
- DonaldPShimoda 9y agoI think it’s more likely they may have been referring to how it’s considered idiomatic to use extremely terse variable and function names in Haskell (and indeed in most functional languages).
- chongli 9y agoThis is a habit borrowed from math. It often makes a lot of sense, however. Giving a variable a long name often unnecessarily ascribes intent to the variable. When a variable is generic enough to represent almost anything, giving it a specific name is potentially misleading.
- coldtea 9y ago>I don't believe non-textual names have any place in programming. I have used Haskell and it is an unmitigated disaster. And yet millions of programmers use && and not and, || and not or, { } and not begin, end, down to things like => to mean bound-closure in JS, with no issue at all.
- sebnap 9y agoThis is a bad example, these are symbols. Like +,-,*,/,e,π,µ, ... in maths. These symbols can represent a relation between the named things he referred to. They are widely used and have more or less the same meaning across different languages.
- coldtea 9y agoNot sure of the distinction. If symbols "like in math" are OK, then math also use symbols x,y,z etc for the items in an equation/function etc, not just for the operators.
- nol13 9y agoof course every time i type '&&' i still say 'and also' in my head