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

If you nest a pair of "for" loops in a C program and use "i" and "j" as the loop counters, few reviewers would bat an eye. In this context, used consistently, the single letter carries semantic meaning.

In K, lambdas use the variable names "x", "y", and "z" for arguments by default. If you see an "x", it is the function's first argument. If you see a "y" but no "z" in a short definition, you know it's a dyadic (arity 2) function. Removing unnecessary degrees of freedom in this manner (among other conventions and stylistic choices) makes it much more likely that two K programmers will arrive at character-for-character identical solutions to problems. The uniformity and consistency makes idioms and repetition stand out.

Arthur-style C is built on the same basic concept: remove unnecessary degrees of freedom, focus on internal consistency. A very short name can still be descriptive if it is always used to mean the same thing.



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

Search: