• The Beauty of Perl

    From Rainer Weikusat@21:1/5 to Mart van de Wege on Tue Oct 13 20:30:14 2020
    Mart van de Wege <mvdwege@gmail.com> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    Mart van de Wege <mvdwege@gmail.com> writes:
    Henry Law <news@lawshouse.org> writes:
    On 12/10/2020 10:38, Mart van de Wege wrote:
    This is fucking horrible code. What is 'vals'? What is 'wk'? What is >>>>> 'cur'? Is it 'current' or 'currency'?

    I'm not even pointing at your obvious pride in writing as compact as >>>>> possible by packing as many skis into one expression instead of using >>>>> subexpressions for clarity, just your variable naming alone shows you as >>>>> an absolute egotist incapable of writing code for others.

    This post is an example of a growing trend: the completely unwarranted >>>> and vicious put-down of someone in public.

    To you and all tone policers: fuck off. This is Reiner, who never holds
    back either.

    This is actually Rainer. And he is not responsible for any kind of
    "enemy stereotype" you like to push onto him.

    Playing 'gotcha' with typos is not helping your case.

    You won't ever change your opinion re: my suitability as exemplary
    replacement scapegoat for your pet cause. Hence, I don't care.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mart van de Wege@21:1/5 to Rainer Weikusat on Tue Oct 13 21:16:54 2020
    Rainer Weikusat <rweikusat@talktalk.net> writes:

    Mart van de Wege <mvdwege@gmail.com> writes:
    Henry Law <news@lawshouse.org> writes:
    On 12/10/2020 10:38, Mart van de Wege wrote:
    This is fucking horrible code. What is 'vals'? What is 'wk'? What is
    'cur'? Is it 'current' or 'currency'?

    I'm not even pointing at your obvious pride in writing as compact as
    possible by packing as many skis into one expression instead of using
    subexpressions for clarity, just your variable naming alone shows you as >>>> an absolute egotist incapable of writing code for others.

    This post is an example of a growing trend: the completely unwarranted
    and vicious put-down of someone in public.

    To you and all tone policers: fuck off. This is Reiner, who never holds
    back either.

    This is actually Rainer. And he is not responsible for any kind of
    "enemy stereotype" you like to push onto him.

    Playing 'gotcha' with typos is not helping your case.

    --
    "We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Randal L. Schwartz@21:1/5 to All on Wed Oct 14 21:07:25 2020
    "Mart" == Mart van de Wege <mvdwege@gmail.com> writes:

    Mart> Remember how this "be smarter than the rest of the sheep" led to Perl Mart> golf, and people making jokes about 'write-only' language? The community Mart> spent years rectifying that and pushing best practices, so why the fuck Mart> would you accord any respect to a dinosaur from that time?

    I'd say JAPHs (which predated Golf) deserve an equal or greater blame,
    for which I have repeatedly apologized.

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/Dart consulting, Technical writing, Comedy, etc. etc.
    Still trying to think of something clever for the fourth line of this .sig

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to Randal L. Schwartz on Thu Oct 15 15:13:33 2020
    merlyn@stonehenge.com (Randal L. Schwartz) writes:
    "Mart" == Mart van de Wege <mvdwege@gmail.com> writes:
    Mart> Remember how this "be smarter than the rest of the sheep" led to Perl Mart> golf, and people making jokes about 'write-only' language? The community
    Mart> spent years rectifying that and pushing best practices, so why the fuck Mart> would you accord any respect to a dinosaur from that time?

    I'd say JAPHs (which predated Golf) deserve an equal or greater blame,
    for which I have repeatedly apologized.

    I don't think anything "deserves a blame" for this ill-conceived bundle
    of fiction. People refer to Perl as "write-only language" because of the liberal and unconventional use of symbol characters in the syntax (a significant barrier to understanding for people who have "general
    programming knowledge" but who are not very familiar with the Perl
    syntax itself).

    And then, because it used to be the language of choice for people whose
    only mode of operation is "ingenuitively hack something together which sometimes works somehow" (I've seen examples of such code) as it was
    easier to use than C. Nowadays, most of these people use Python and
    their Python-code is just as "write-only" just in a differently looking
    way.

    Finally, a lot of people always make a mess of it whenever the code
    something, regardless of programming language. Copy'n'paste something
    which didn't run away quickly enough and change that only to the degree
    that it sort-of works is a great and really popular way to accomplish
    this. Ideally (sarcasm) all of the code gets change and all of the
    original comments are kept intact :->.

    Using hash slices to extract sets of values from hashes is not an
    extordinary 'advanced' concept and neither is "anonymous arrays storing references to other anonymous arrays", at least not in object-oriented
    code.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mladen Gogala@21:1/5 to Rainer Weikusat on Sat Oct 17 22:46:05 2020
    On Thu, 15 Oct 2020 15:13:33 +0100, Rainer Weikusat wrote:

    I don't think anything "deserves a blame" for this ill-conceived bundle
    of fiction. People refer to Perl as "write-only language" because of the liberal and unconventional use of symbol characters in the syntax (a significant barrier to understanding for people who have "general
    programming knowledge" but who are not very familiar with the Perl
    syntax itself).

    Perl is far from "write only". I have perl scripts from 2007 that I am
    still maintaining because they're useful. I am an Oracle DBA, so I have
    Perl scripts to dump tables to CSV or XML, draw ER diagrams of the given
    schema and summarize performance aspects of an Oracle database in a few
    nice reports. I have been adjusting those scripts from Oracle v8. Before
    that, I was using Perl4 and "oraperl", Perl4 executable with Oracle
    bindings linked into the executable itself. Whenever there is a new major version of Oracle, there is a need to modify my scripts. I've never had
    any problems with them


    And then, because it used to be the language of choice for people whose
    only mode of operation is "ingenuitively hack something together which sometimes works somehow" (I've seen examples of such code) as it was
    easier to use than C. Nowadays, most of these people use Python and
    their Python-code is just as "write-only" just in a differently looking
    way.

    Python is much more verbose. And the idea of the mandatory indentation
    comes from COBOL, today a largely forgotten monstrosity. Python is a
    truly OO language, as opposed to Perl, which is mostly procedural. What
    we are discussing here are the merits of the OO programming paradigm.
    Again, being a DBA, I am mostly loading or dumping data and writing
    reports. Those are all procedural tasks. I don't need classes and
    inheritance for that. Using Python for that is like trying to put a
    square peg into the proverbial round hole. However, it is true that
    Python has won and it is practically the only scripting language in wide
    use today. It is possible to use it much like Perl. Visual Studio for
    Linux has many useful extensions for Python, the most useful being Kite
    which implements autocompletion. I am aware that Visual Studio is a MS
    product, not a language feature, but it is really helpful. Python isn't
    that bad. You have to stop worrying and learn to love Python. Any
    resemblance to the subtitle of "Dr. Strangelove" is purely accidental.





    --
    Mladen Gogala
    Database Consultant
    http://mgogala.byethost5.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to Mladen Gogala on Tue Oct 20 21:25:52 2020
    Mladen Gogala <mgogala@yahoo.com> writes:
    On Thu, 15 Oct 2020 15:13:33 +0100, Rainer Weikusat wrote:

    I don't think anything "deserves a blame" for this ill-conceived bundle
    of fiction. People refer to Perl as "write-only language" because of the
    liberal and unconventional use of symbol characters in the syntax (a
    significant barrier to understanding for people who have "general
    programming knowledge" but who are not very familiar with the Perl
    syntax itself).

    Perl is far from "write only". I have perl scripts from 2007 that I am
    still maintaining because they're useful. I am an Oracle DBA, so I have
    Perl scripts to dump tables to CSV or XML, draw ER diagrams of the given schema and summarize performance aspects of an Oracle database in a few
    nice reports. I have been adjusting those scripts from Oracle v8. Before that, I was using Perl4 and "oraperl", Perl4 executable with Oracle
    bindings linked into the executable itself. Whenever there is a new major version of Oracle, there is a need to modify my scripts. I've never had
    any problems with them

    I don't support this claim ("write only language"). But the expression I originally posted,

    @vals = @$kv{@{$$cur[KWDS]}}

    is going to look pretty daunting to someone not familiar with Perl dereferencing syntax: stripping out the letters leaves one with

    @${@{$$[]}}

    and - to the best of my knowledge - constructs like this area really
    unique to Perl. Something I'recently noticed while having to read through
    some code written in Rust: conventions for use of symbol characters one
    isn't familiar with appear very bizarre when one encounters them.

    Also, I think people simply don't like the feeling of looking at
    something which obviously must have made sense to somebody despite they
    don't have the slightest idea what it means. In order to get around
    that, they fault the language for being unknown to them.

    And then, because it used to be the language of choice for people whose
    only mode of operation is "ingenuitively hack something together which
    sometimes works somehow" (I've seen examples of such code) as it was
    easier to use than C. Nowadays, most of these people use Python and
    their Python-code is just as "write-only" just in a differently looking
    way.

    Python is much more verbose. And the idea of the mandatory indentation
    comes from COBOL, today a largely forgotten monstrosity. Python is a
    truly OO language, as opposed to Perl, which is mostly procedural.

    "Truly OO" usually means "can't express anything else due to political decisions by the language designers/ developers". But this kind of
    ideological restriction are of limited, practical effect as people are
    going to write procedural code, anyway. :->

    [...]

    However, it is true that Python has won and it is practically the only scripting language in wide use today.

    [...]

    Python isn't that bad. You have to stop worrying and learn to love
    Python. Any resemblance to the subtitle of "Dr. Strangelove" is purely accidental.

    I'm not "worrying" about Python, it's just another programming language
    I wouldn't ever use unless this is required for some reason, ie,
    working/ maintaining code written in Python (something I do) or using it because someone supposed to give order wants it to be used.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mart van de Wege@21:1/5 to Rainer Weikusat on Wed Oct 21 10:28:02 2020
    Rainer Weikusat <rweikusat@talktalk.net> writes:


    I don't support this claim ("write only language"). But the expression I originally posted,

    @vals = @$kv{@{$$cur[KWDS]}}

    is going to look pretty daunting to someone not familiar with Perl dereferencing syntax: stripping out the letters leaves one with

    @${@{$$[]}}

    and - to the best of my knowledge - constructs like this area really
    unique to Perl. Something I'recently noticed while having to read through some code written in Rust: conventions for use of symbol characters one
    isn't familiar with appear very bizarre when one encounters them.

    I was not objecting to the symbols. Anyone with a decent knowledge of
    Perl can read those, even if they may have to carefully count out the references.

    Also, I think people simply don't like the feeling of looking at
    something which obviously must have made sense to somebody despite they
    don't have the slightest idea what it means. In order to get around
    that, they fault the language for being unknown to them.

    I was, however, objecting to the egocentric use of completely unclear
    variable names, which is the epitome of a culture that thinks the
    individual smarts of the programmer writing the code is more important
    than being clear to other programmers who have to read the code.

    A culture that *used* to plague Perl quite a lot, valuing 'smartness'
    over readability.

    Thanks to the hard work of people like Damian Conway (among others,
    writing Perl Best Practices), this has mostly been stamped out. And note
    that if you look at Conway's code, and his work as an educator, you can
    hardly accuse him of not being smart.

    Mart

    --
    "We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mladen Gogala@21:1/5 to Rainer Weikusat on Mon Oct 26 03:13:17 2020
    On Tue, 20 Oct 2020 21:25:52 +0100, Rainer Weikusat wrote:

    or using it because someone supposed to give order wants it to be used.

    That's my primary reason for learning Python.


    --
    Mladen Gogala
    Database Consultant
    http://mgogala.byethost5.com

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