Talk:Bitmap: Difference between revisions

m
provided example
(→‎Amount of comments: Comments are good where they add clarity. Code Golf is sometimes in the eye of the beholder!)
m (provided example)
Line 46:
:::: The second category of documentation (description of what the code is doing) can be very helpful to someone trying to understand the approach that has been taken - see [[Happy_Number#J]]. In many cases a big increase in readability can be accomplished by the judicious naming of intermediate functions and objects.
 
:::: With regards to the Code Golf comment, I agree that the objective is not to show the shortest possible answer, and I understand that sometimes solutions, especially for a language like J, will be perceived by someone not familiar with it as an attempt at Code Golf. In most cases though I think that is a misconception and is simply due to the increased semantic density of the language achieved by its grammar and use of symbols to represent functions and operators. This is similar to the difference between the representation of a phrase or concept using one or two Chinese characters rather than a whole sentence in English. I don't know any Chinese and I don't expect to understand it without first learning the meaning of the individual symbols. On the other hand I admit that in many cases the readability of some solutions (especially for beginning users) could be improved by breaking up longer lines into shorter chunks and giving them appropriate names - for example the [[Standard_Deviation#J|J solution for Standard Deviation]] could have been provided as the one-liner: <lang j> stddevP=: [: %: +/@:*:@(- (+/ % #)) % #</lang> - not an especially complex J expression, but breaking it up in to chunks as on that page adds to readability in my opinion. --[[User:Tikkanz|Tikkanz]] 22:51, 30 August 2009 (UTC)
892

edits