User talk:Hout: Difference between revisions

(→‎Functional Python and pythonic Python: The spirit of Rosetta is to be inspired more by what is shared than by what is different.)
Line 202:
 
: 'Pythonic' Python is an excellent subset of Python, well optimised for many purposes, but it is not the Python language itself.
 
: Some useful parts of Python, including parts of the language which are well suited, or even essential, to functional programming, lie outside the scope of the Pythonic idiom, which is deliberately optimised for standardisation of imperative programming styles.
 
: Functional programming is a distinct and well-established use of Python. There is an introduction to it in the Python documentation. O'Reilly distributes a book about it. Chapters are devoted to it in other books. There is extensive discussion of it online, and significant use of it in projects.
 
: It is not constructive to attempt to exclude functional Python from Rosetta Code on the grounds that it differs from the Pythonic idiom which (for excellent and understandable reasons) you personally like, respect and use. Others do use, and benefit from using, functional Python.
 
: You often explain that the notion of 'idiomatic' is central to your own contribution to Rosetta Code. I respect that, and find it entirely understandable. You are an intelligent person, and therefore will also have no difficulty at all in understanding that the goal of the Rosetta project, summarised on the landing page as ''to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another'' will attract both readers and contributors whose interests have varying balances of emphasis on '''similarity''' and '''difference'''.
 
: Perhaps you feel that crowds gather around the Rosetta Stone in the British Museum to be inspired and elevated by the exemplary idiomatic purity of its parallel Greek, Demotic and Hieroglyphic texts. If that is your belief, then I am very happy to respect it. No problem at all. The value that I personally attach both to the Rosetta Stone, and to the eponymous Code project, lies, however, in what is '''shared''' between languages. Meaning, deep structure, universal functions, shared reducabilty, to the Lambda calculus and the operations of Turing machines. I personally happen to be less interested in the surface phenomena and the differences, but I have no objection whatsoever to others being more preoccupied by difference than by similarity.
 
: It worries you that my functional Python bears some resemblance to Haskell. For me, and, I believe, for some other Rosetta Code readers, that constitutes a virtue – a visible sharing, beyond superficial differences, of deep structure. It can be very instructive to compare the implementations of '''concatMap''', for example, in different languages. The (concat . map) composition itself is '''not''' given to us by Haskell. It comes from a much deeper and more interesting level of shared meaning – mathematics, from which in the last analysis, no programming language can successfully escape, or fail to be structured by.
 
: Two technical points, and then a general one. '''First – consistent idiom''' – Our interests in Rosetta Code may diverge in the balance of our emphases on '''deep and shared''' versus '''surface and different''', but we do overlap, I think, in feeling that well-linted code has a value. We won't agree on which idiom of Python we find most useful, but we can agree that it is useful to apply linter tools. I apply Linter-flake8, and use AutoPep8, with all my Python code, both for Rosetta, and for my working projects. Let's move on, avoid subjective idiom wars – they seem a slightly silly waste of time – and defer to the tooling.
 
: '''Second - Semantic type comments''' I think that the use of informal Hindley-Milner style semantic type comments in my Python code may be near to the heart of your aversion to my functional Python style as 'too Haskell-like' (let's ignore the offensive references to machine translation :-). I find these semantic type annotions very helpful to my planning and reading of code, and perhaps, since we are only talking about comment lines in code, it should really be enough to say that they are useful. But in case it reassures you: (1) the Pep8 linters which I use have no objection to the position of my comment lines, and (2), I am far from alone in using such comments in functional Python, and in functional uses of many other languages outside the family of ML and Haskell. See, for example, some of the slides in this very helpful presentation: https://speakerdeck.com/kachayev/monadic-parsing-in-python
 
: '''Finally, a suggestion''' rather than fight for years over whether particular instances of functional Python are 'Pythonic' enough for you, (they are unlikely to be – some central elements of functional programming were deliberately excluded from the Pythonic tent, though the community refused to have them removed from the Python language) let us instead just accept that functional Python, while real, documented, written about and used, is nevertheless distinct from the 'pythonic' Python. I am very happy to go on using PEP8 linters, indeed I think it's a good idea, but why don't we just develop a practice of dividing Python contributions into two subsections: '''Pythonic''' and '''Functional'''.
: Let's stop the silly campaign of attrition though – I believe that the spirit of Rosetta is to be more inspired what is '''shared''' than by what is different., [[User:Hout|Hout]]and ([[Userfrankly, talk:Hout|talk]])I 12:08,begin 28to Octoberfeel 2018harassed. (UTC)
 
: If you don't like my functional Python word break parsing code, for example, just contribute a version which feels more Pythonic to you. No need at all to berate me. A a different approach and better version is a much more interesting and constructive mode of criticism. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 12:08, 28 October 2018 (UTC)
9,655

edits