Talk:Check Machin-like formulas: Difference between revisions

→‎Floating-point calculations: thanks & thoughts on more literate code
(→‎Floating-point calculations: thanks & thoughts on more literate code)
Line 22:
:--[[User:DanBron|DanBron]] 20:04, 20 December 2012 (UTC)
:: Normally [http://en.wikipedia.org/wiki/Extended_precision extended precision] means floating-point with greater precision, however I will accept your explanation. The J code is very terse, it would be useful to readers if you or someone else can add a brief description to the solution of how it implements the algorithm.
::: Thanks, I hadn't realized J's terminology was non-standard. I'll change the note on the solution to say "exact arithmetic" rather than "extended precision numbers".
 
:::Regarding the style of the solution: J's compact notation is one of, if not the most, salient feature of the language. So, when I post solutions to RC, I try to emphasize it.
 
:::Because J's orthography is symbolic rather than textual, as most other languages are, anyone who wants to read it in effect has to learn a whole new language. Knowing Java and trying to read J is somewhat analogous to knowing English and trying to read Japanese. So, given that that's a high bar to hurdle, I try to give my audience some impetus to make the leap.
 
:::I'm hoping that repeatedly seeing J solutions which are short, sharp, and crisp, especially on tasks where other languages need to expend paragraphs or even pages of code, will provide that impetus. To be clear: I don't play code golf with my solutions (you really don't want to see me do that in J), but I do try to keep the code clean and uncluttered, with minimal narrative (e.g. breaking out trivial sub-functions, overlyLongVariableNames, patronizing comments, etc). The alternative is to write longer, more tutorial-style solutions, which given J's alien nature, would amount to a language primer rather than an algorithmic overview.
 
:::To put it another way: if learning J is analogous to learning Japanese, then teaching J is analogous to teaching Japanese, and marking-up the solutions is analogous to trying to elucidate the beauty of a Japanese haiku to who is only familiar with English ballads.
 
:::Of course, we don't have to choose one extreme or the other. If I think a solution merits deeper consideration, sometimes I (or my J-brethren) will write up a longer exposition on the task's Talk page, and link to it from the solution, e.g. [Talk:Zig_Zag#reading_the_J_examples|Zig Zag] (which explanation helped other languages improve their solutions). But explanations of that depth take a bit of time to write, so I don't it for every solution.
<BR/>--[[User:DanBron|DanBron]] 23:34, 21 December 2012 (UTC)
Anonymous user