I find that my experiences and insights from working with J transport to other languages (often with some frustrations, but life is full of frustrations) in a useful fashion.
It would take some time, but I imagine you could translate that code you wrote into another language (perhaps paraphrasing parts, depending on your thinking and the target language). In a much smaller amount of time, I imagine you could take that code and rephrase it to be more suggestive and "digestible". As a start, I'd try thinking up names for every parenthesized phrase (possibly adjusting the boundaries of the parenthesis or the behavior of parts of the code, if that makes it easier to name or describe). Put differently, it's often worthwhile to think of code as being a "draft document". J is a tool of thought, but that should not prevent you from using other tools nor from having other thoughts. J can be incredibly productive but it's sometimes worth putting in a little extra effort with an eye towards helping other people understand your thoughts. That said, you do not need to be immediately critical of your work. Sometimes it's better to just write it down and get onto other issues and trust that you will probably have time to come back later. I've often noticed myself being impatient with things I had written before, and I like to think that my subsequent edits have sometimes helped other people understand my code (especially at rosettacode). Finally, I think that one of our big limitations, as technical people, is that we often lack audience for our work as individuals. But since everyone faces analogous difficulties (and team efforts get some emphasis for a variety of reasons), I'm not sure if that's so much a characteristic of the technicalities or just something inherent in people. Thanks, -- Raul On Mon, Jan 13, 2014 at 1:45 PM, Dan Bron <j...@bron.us> wrote: > We often say the APL family of languages allow us to use language as a tool > of thought. How does this play out in practice? Do we approach reading J > programs differently from those written in other languages? If so, how? > > These questions occurred to me today while I was knocking together an > implementation of a RosettaCode task on reading configuration files. The > task is to parse file formatted like the following: > > # This is the fullname parameter > FULLNAME Foo Barber > > # This is a favourite fruit > FAVOURITEFRUIT banana > > # This is a boolean that should be set > NEEDSPEELING > > # This boolean is commented out > ; SEEDSREMOVED > > Fuller example at [1]. After reading the intro, I copy/pasted the example > into a J noun and proceeded to write this: > > deb L:0@:(({.~ ; [: < [: ;^:(1=#) ',' cut (}.~>:)) i.&1@:e.&' =')&>@(#~ > a:&~: > ';#'e.~{.&>)@:(dlb&.>)@:(LF&cut) > > Which is a verb which takes the configuration text as input and produces a > table of name-value pairs as output. My first thought was "wow, I was able > to knock that together in literally less than a minute, through simple > incremental iterations in the REPL: J is AWESOME". > > But then, thinking about posting it, I realized "this is awful, no one's > going to be able to read it like this, and it's going to take more work to > make it readable than it took to make it actually work". > > So that got me thinking about what exactly we mean by J as a notation. And > I wondered: how could we use the language to express our thoughts more > clearly, and how does that differ from how we write J when we just want to > get something done? And is this a different or more difficult problem for > J than other languages? > > So, how would you write an configuration file parser in J, if clarity were > an important concern? I'm interested in not only the actual program, but > the reasoning behind the decisions you make. > > -Dan > > [1] RosettaCode task to read a configuration file: > http://rosettacode.org/wiki/Read_a_configuration_file > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm