in reply to On Translating Code

I'm not sure the analogy is helpfull. It's a good analogy when comparing abilities of different programming languages, but much less helpful comparing a "natural" language with a "programming" language or even a "mathematical" language.

The issue is more to do with different levels of expression - natural languages at one level, programming languages at another and mathematical languages at another level where the progression to each level represents a general increase in terseness. Sure, there are programming languages that attempt to look like natural languages and some programming languages are terse to the point of looking like mathematics (APL springs to mind), but generally there is a fairly clear distinction between the expressiveness per symbol for each of the levels.

It's not clear to me though that everyone who is fluent in a programming language "thinks" in the language. When you (presuming Perl fluency here) encounter something like /wibble/ do you think "m//" or do you think "match"? It is clear that not all programming language use equivalent constructs and that your analogy applies exactly between programming languages. Consider the equivalent of "m//" in languages such as C or Pascal for example.

The virtue in "translating" a chunk of code into a natural language is in being able to express and examine how the code works. If you can't do that then there are real problems for maintainers.

In fact I'd consider programming languages much more akin to a form of implicit compression of ideas expressed in a natural language, rather than a translation. Sure, you can express concepts in a programming language that many people are not familiar with, but that's not due to the representation, it's because they are simply unfamiliar concepts. Writing a story to convey a concept is a different thing than decompressing an expression to a more verbose form. I think the issue with the meditation that stimulated this meditation was more to do with an understanding gap due to lack of suitable concepts than any issue with decompressing the Perl representation into an English representation - as can be seen in some of the OP's follow up questions to various of the replies (see Unusual coding arrangements in Perl).

Direct translation of Perl (or other language of your choice) into English aids propagation of knowledge and assists growth in understanding the application of the many idioms used in the language. If you can't translate a technique into English you can't convey a it to anyone else who hasn't your understanding of the technique and you will inhibit their growth in understanding and proficiency.

In summary, succinct does not have to mean obscure, but a lack of appropriate knowledge will make anything obscure. Translation is often essential to understanding - few non-natural languages facilitate bootstrapping understanding.


DWIM is Perl's answer to Gödel