J/HouseStyle: Difference between revisions

→‎{{header|J}}: reply to Tikkanz
(→‎{{header|J}}: like the suggested format)
(→‎{{header|J}}: reply to Tikkanz)
Line 112:
 
: I like the outline for J solutions described above. A significant number of solutions follow this format already. Should there be guidelines for formatting code too?--[[User:Tikkanz|Tikkanz]] 21:29, 10 December 2009 (UTC)
:: Do you have anything particular in mind? I'm pretty relaxed about this. Some fine-grained stylistic rules I personally like to follow:
:::# Ancillary definitions that shouldn't persist in the namespace should be defined locally (<code>=.</code>); main verbs which solve the task or otherwise deserve attention should be defined globally (<tt>=:</tt>). Global names which rely on local names should fix (<code>f.</code>) them.
:::# Space a line of code according to J's rules of binding power (e.g. put verbs directly adjacent to conjunctions, space out trains a little, etc).
:::# Minimize parens. Maximize use of forks (this isn't an endorsement of capped fork, though that does allow certain verbs to scan better).
:::# Control on the left, data on the right. This extends to verb trains in the sense that the more complex tine should be on the right, and <code>~</code> used on the middle tine as required.
:::# For the sake of legibility to others, I will try to eschew tacit adverbs. But I'm addicted, so I can't make any guaruntees.
 
::I've got a bunch more that don't occur to me immediately. But I'm interested in what you (and others) have to say. As I said, this is not as important to me as "big picture" style and formatting -- I still want to allow individual authors to express their own styles. --[[User:DanBron|DanBron]] 21:51, 10 December 2009 (UTC)
Anonymous user