4 ms·
names work well in programs because the variable typically models something in the world we understand. company.name, NetworkConnection, etc. In math and in pr
by justinmeiners 7y ago
names work well in programs because the variable typically models something in the world we understand. company.name, NetworkConnection, etc.
In math and in programming this isn't always the case. Often you have a variable "epislon" that means "the tiny amount of space between this circle and the other circle that is shrinking".
In these cases there is no good name to give the variable. The meaning comes from the context.
In programming I follow the practice of using longer identifiers for more global scope, and shorter ones for smaller scope.
Which do you prefer?
(define (sqr x)(* x x))
(define (sqr number_to_square) (* number_to_square number_to_suqare))
- bcrosby95 7y agoEither over this: (define (s x) (* x x)) Which is effectively what the OP does when they write their example. Their simple example quickly becomes unreadable after a few definitions.