User talk:Hout: Difference between revisions

Line 161:
: Thanks for looking at that – it does seem intractable at the moment, but at least we have pointed people to the possibility of viewing it in Firefox [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 22:09, 22 November 2016 (UTC)
 
 
==Functional Python and pythonic Python==
==Pythonic code==
Hi, You've stated that you don't think PEP-8 applies to your functional code. Have you tried to get PEP-8 updated as yet?
 
Line 201 ⟶ 202:
[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 10:44, 28 October 2018 (UTC)
 
===Functional Python and pythonic Python===
: 'Pythonic' Python is an excellent subset of Python, well optimised for many purposes, but it is not the Python language itself.
 
That is right. One can write bad code in any language; Pythonic refers to the communities best attempts at guidelines for writing good Python. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
 
: 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.
Line 208 ⟶ 212:
 
: 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.
 
I don't wish to exclude one of Pythons three main coding styles, and don't seek to. You misrepresent me, deliberately. You act as if all of Pythons good practices are beneath you because functional is best. You substitute your own type comments as comments - no need for docstrings. You create new functions hiding builtins willy-nilly; you create new functions with the same functionality, but different names to standard library functions; In short, you ignore Pythons best practices with the excuse that "it's Python isn't it"?
 
If your ideas have merit, then you should b able to convince the Python ''community''. That community that built those same libraries and eco-system that you stated you use'. That eco-system exists because of the actions of that community you eschew. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
 
: 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'''.
Line 214 ⟶ 222:
 
: 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.
 
Compare and contrast the rise and fall of the Lisp language. Also said to be based on maths, and originally from academia. Lisp has enriched later languages, but has gone from being "The Next Big Thing", with Lisp processors and Lisp workstations, to its current marginal use. Python has functional programming as one of many styles it supports. It may not have fully embraced functional programming as you would like, but maybe you to are blinded by your "Lisp moment". [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
 
: 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
 
''I find these semantic type annotions very helpful to my planning and reading of code, ...''<br>
And yet you ignore the Pythonic style of adding them to docstrings or of adapting and using the type annotations that Python has. It looks as if you steamroll your way through that which inconveniences '''you'''. Rather than convince the community, you independently profess yourself a special case and that the guidelines don't apply to '''you'''. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
 
: '''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, and frankly, I begin to feel harassed.
 
'''A (repeated) suggestion''': If your ideas have merit then you should be able to convince the Python community of its merit.
Your style seems singular. Members of the Python community do change the language. What is Pythonic does evolve, but standing on the sidelines shouting "Don't you see"!! might not be the best way to create a change toward your style. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]])
 
Harass. Defined as "Subject to aggressive pressure or intimidation". I am not being aggressive. I disagree with you - it happens. Intimidation: I don't slap an improve tag on your entry without stating why. Pressure: I am trying to improve your Python; we unfortunately disagree. [[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
 
: If you don't like my functional Python word-break parsing code, for example, just create a 'Pythonic' sub-header, and contribute a 'version which feels more 'pythonic' to you. No need at all to berate me. 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)
Line 238 ⟶ 256:
 
::: Set comprehensions are exactly the kind of thing that we need – practical and mathematically well-founded enough to inspire complete confidence, as well as powerful and elegant. In the word-break example (and sometimes elsewhere) I have shown the desugared underlying list monad version, not just because it can be interesting or more flexible to understand what's going on under the hood or bonnet, but also because my experience has been that the insight helps my intuition in using even the sugared version (in Python, Haskell or elsewhere) more fluently, and with more clarity. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 14:11, 28 October 2018 (UTC)
 
:::: On Perl-6 and Haskell I guess <code>TIMTOWTDI + Haskell == TIMTOWTDI</code>, little change.<br>
:::: Pythons idioms are used to allow libraries initially coded in other languages to act like native libraries and datastructures. The Python community believes it makes it easier to use such libraries as they are expected to act similarly and be more easily maintained.<br>
:::: P.S. I genuinely wish Perl-6 good luck (again). If its new ideas gain traction who knows, Python might add a library... :-)<br>
[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 16:12, 28 October 2018 (UTC)
Anonymous user