[emacs-berlin] Literate dev-ops

Andreas Röhler andreas.roehler at easy-emacs.de
Thu May 12 13:18:58 UTC 2016



On 12.05.2016 06:37, Murat Knecht wrote:
> Hello,
>
> just a thought on the literate programming:
>
>>   And some more basic concern: the underlying literate programming
>> paradigm seems pointless WRT examples given in video. Why comments in
>> natural languages should be preferable over code? Code has the purpose
>> to be less ambiguous, it's a kind of math. While natural language
>> gives way to interpretation, i.e. misunderstanding of all kind. Maybe
>> literate programming was of interest in earlier times in a world of
>> low level coding. Higher languages are adapted at human mind, let's
>> use them.
> Imho, LP should follow the same guidelines as code comments. If you
> explain *what* you do, you should clean up your code. (Unless you're
> doing advanced maths, then please explain what you do. ;) ) But often,
> it's not clear *why* you're doing it at all or in this way, why you
> overrode the default, why you chose this solution over another. Can I
> “refactor” this code with an alternative solution — or was there a
> reason for this? Some implicit dependency that I don't know about?
> That's where comments are useful and absolutely necessary. For LP the
> question is, if enough such situations arise to justify the inversion of
> the default language (English vs bash/Python) in the file.
>
> Cheers,
> murat
>
> _______________________________________________
>

Well, habits differ. There must not exist a single solution or way to go 
which fits equally for all.

In job advertisements and the like we see the formula to "live in code". 
Indeed, writing code feels often like speaking a natural language. But 
then switching to comments is like switching that language. Speaking two 
languages at once is costly, it might break the flow.

Comments to mark hidden dependencies? Often there is a plenty of hidden 
dependencies. WRT any larger program you will need tests to check for 
breaks - and read and understand the code themselves, before changing.

There are some more aspects why comments in code IMO are rather 
distracting then helpful: while computers and code behave logically, 
programmers quite often do not, tend to be biased instead - me included :-)

Cheers,

Andreas







More information about the emacs-berlin mailing list