• The Zen of D.E.K.

    From Stefan Ram@21:1/5 to All on Fri Jan 13 17:06:00 2023
    Supersedes: <Zen-20230113175927@ram.dialup.fu-berlin.de>

    "Beautiful is better than ugly." - The Zen of Python

    This says nothing. You have to sacrifice something that
    really has /value/!

    "[A]esthetics are more important than efficiency." - Donald E. Knuth

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ethan Furman@21:1/5 to Stefan Ram on Fri Jan 13 10:00:01 2023
    On 1/13/23 09:06, Stefan Ram wrote:

    "Beautiful is better than ugly." - The Zen of Python

    This says nothing. You have to sacrifice something that
    really has /value/!

    "[A]esthetics are more important than efficiency." - Donald E. Knuth

    [okay, falling for the troll bait]

    Those two things do not say the same thing; further, in Python at least, and depending on the situation, aesthetics may
    /not/ be more important than efficiency.

    --
    ~Ethan~

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to Ethan Furman on Fri Jan 13 20:46:57 2023
    On 2023-01-13 10:00:01 -0800, Ethan Furman wrote:
    On 1/13/23 09:06, Stefan Ram wrote:
    "Beautiful is better than ugly." - The Zen of Python

    This says nothing. You have to sacrifice something that
    really has /value/!

    Time?

    Making something beautiful takes time.


    "[A]esthetics are more important than efficiency." - Donald E. Knuth

    [okay, falling for the troll bait]

    Those two things do not say the same thing; further, in Python at least, and depending on the situation, aesthetics may /not/ be more important than efficiency.

    This is true independent of language.

    Aesthetics /may/ be more important than efficiency.
    Aesthetics /may/ not be more important than efficiency.

    It depends on the application.

    Although I would deposit that if you care about run-time efficiency (as
    opposed to developer-time efficiency), Python might not be your language
    of choice at least for the part where efficiency is crucial.

    hp


    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmPBtTEACgkQ8g5IURL+ KF1AqQ//ffewr4wTjfC51AoosPZE5/csYM17MCIVhFmEkwNEmWZN9/LlJV3zADoA SteHQ8rMWxAWP4bl7/4l23Y8AkGLlPb0IWIBCaw8e83S6ezHhK4EkyH0jG9aqqOG mWn9/oXPmQ0NApCp49RVGIza3FgvENiUv/x+GHJAWZsEVH9r69RhTpGd7493KA5/ bQIwpwU+1zz0aRKS3iWZQYQfVdaOuP0Lj4fK9paHLDK97FbjS5cs6AnLG77s83Dv iHY2tTtn9TJD3pchAJA/neJI2q8louR4jQsGmH4MqiCkr6MtXVhIiFLg48pE7DsD aFCLuyrLIRaYgYal+PrtX5Rpvlz8iFtcvEnttlz83IJchd82+omB6OGzeHFy/wEE ScpoNxBmim4Up4yCg+iC1ySJ4/ix0X6SX1hb6/gXvs3u94zoZ64z1CdgNGPiTkYs T4JF4HV+Hyq2qV9tjgpTPdAcxJTIi3/1cxodPY/ehpubeCATSuDkDHYYzA7VGfY5 0Z9KAOFLtTQZxRlhhh7ZgtA/dV7aFnYr0OgDjJTcbShXb6phOiW688neejEd0luz W9ZmEmuUr6O/KCci+vQ1B5St504qzsbXb1xyK6ZX7BZVTdvOvWeuiEjLAYv8FY0R erWa0kAJGDGvmf9si+5HS9fDDYOkIMVBeGtIgfI
  • From avi.e.gross@gmail.com@21:1/5 to Stefan Ram on Sat Jan 14 12:16:57 2023
    I can appreciate a beautiful piece of code but I can also appreciate another piece of code that does things in another pleasing way so there is quite a
    bit of subjectivity here.

    And, in yet another computer language, the implementation of what seems to
    be the same algorithm is somewhat jarring as it does not quite fit the environment.

    Some people consider the symmetry of a language that ends an IF statement
    with FI to be sort of pleasing. Others feel that way about matched opposing braces and yet others like having things the same symbol such as an
    unadorned double quote or slash to be both the beginning and end.

    It goes way deeper than that but I think there is plenty of subjectivity in what people find pleasing. Some adore it if an algorithm is a very curt and mysterious one-liner while others like when code is lined up just so on multiple lines, perhaps using a nice color scheme in their editor. Some
    adore copious detailed comments while others find they get in the way.

    Efficiency is another matter but again has some subjectivity and variations. The same algorithm can be much more efficient in one language/implementation than another but also in other ways can be less. If an algorithm must sort a billion items, the algorithm may dominate the resources used. But to sort a small number of items, the overhead of invoking and loading an external
    module that has a faster method than the built-in way, may be much slower if used only once.

    In the real world, there are other candidates for what is in some sense
    better to do. One example is how fast it can be designed and implemented and another might be if it tends to generate fewer bugs and glitches. A big one
    is if it saves the company money in creating and maintaining it or at
    runtime. And, of course, a good algorithm implementation is one that others, perhaps less extremely educated than you, can later read your code and understand it well enough to modify it, or perhaps port it to another
    language with different ways than the one you wrote it in.

    Efficiency keeps being relative as languages evolve. A change in the interpreter may add features that end up making the feature you chose to
    slow a bit. Replacing some functionality with a version written in a
    language like C that is compiled, can often speed it up. Changing an
    algorithm from using a list to a numpy array can have dramatic differences
    even as the skeleton of the algorithm remains the same in terms of
    aesthetics.

    Amusingly, I have been reading about ideas of Aesthetics and sort of beauty
    by Mathematicians and Physicists in how it guides them in their work. Knuth
    and others in C.S. are arguably doing similar things.

    -----Original Message-----
    From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On Behalf Of Ethan Furman
    Sent: Friday, January 13, 2023 1:00 PM
    To: python-list@python.org
    Subject: Re: The Zen of D.E.K.

    On 1/13/23 09:06, Stefan Ram wrote:

    "Beautiful is better than ugly." - The Zen of Python

    This says nothing. You have to sacrifice something that
    really has /value/!

    "[A]esthetics are more important than efficiency." - Donald E. Knuth

    [okay, falling for the troll bait]

    Those two things do not say the same thing; further, in Python at least, and depending on the situation, aesthetics may /not/ be more important than efficiency.

    --
    ~Ethan~
    --
    https://mail.python.org/mailman/listinfo/python-list

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gilmeh Serda@21:1/5 to Stefan Ram on Sun Jan 15 12:44:50 2023
    On 13 Jan 2023 17:06:00 GMT, Stefan Ram wrote:

    "Beautiful is better than ugly." - The Zen of Python

    This says nothing. You have to sacrifice something that really has
    /value/!

    It does say something!

    Compare with C. I consider Python more beautiful than C, therefore easier
    to read, easier to understand and easier to code, therefore (most likely)
    less bugs. C can be extremely ugly. I think this has a great deal of
    value.

    That's all I have to say about that!

    --
    Gilmeh

    Some of us are becoming the men we wanted to marry. -- Gloria Steinem

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)