Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

(This is part response and part rant...you have been warned!) I read through more of the article and finally know what your code snippet is referring to. Ouch. But this is actually a problem here at PerlMonks. I'll explain.

I think someone familiar with Perl would read this article and grumble...'you are not helping...'

The author has a fairly high score here on this site and, from what I have seen from his posts, can definitely write better code than that. He might have been thinking that producing simpler code would help newer developers or people unfamiliar with the language. However, that is really not helping. People need to learn more Perl by reading and trying things out. It is the responsibility of this site to educate people on this simple point.

If we go back in time to 2019 (I purposefully did not go back too far so we could see recent results) we see one example of what I am talking about. The author's response is clearly wrong and no one has questioned him about it. See: How to loop through hash of array and convert into hash with key and value.. The answer given by the author is incorrect. The correct solution should not have had the key in the individual hashes (as shown in the expected results).

The code provided actually produces this:

#... 'Adam' => { 'total' => 22, 'days' => 22, 'name' => 'Adam' } #...

There should be no name key in the hash.

When I peruse the author's history I find more examples:

  • Re: sqlite show tables - "Here are some working snippets"...code dumping of old snippets should have gotten this author a downvote and been chided for posting irrelevant code and wasting space on the site.
  • array to string - The SQL used clearly will only return a single value (the count of users per a specific location) so I have no idea why no one (the author included) suggested using something like, $hash_ref = $sth->fetchrow_hashref to obtain the answer instead of looping to obtain a single value.

I think PerlMonks users should avail themselves of the opportunity to point out issues with code here. Otherwise you wind up with people writing Perl articles elsewhere that do not represent this language very well. There are nothing short of brilliant posts online as well as books on Perl that can be referred to rather than writing code examples like the ones shown in the liked-to-article.

And the rest is a mess...

"It is still being used in CGI scripts. It is used in several sys admin tasks. Perl is still alive and kicking..."

The entire premise behind this article is flat-out wrong. To summarize, it says 'oh yeah, Perl is still around...you can still use it for certain tasks.' Who says so? You?

The author doesn't mention that Perl can fork or Perl can be used with Starman and other PSGI environments to achieve higher performance. No mention of the websites currently up and running using Perl (look it up -- IMDB, Zappos, Craigslist...the list goes on). There are even load balancers written in Perl. Instead the author keeps talking about CGI as if none of that exists.

Some fellow named Steve summarized my thoughts in the comments of the article:

"Each method and tool chain have their own strengths and weaknesses. CGI works for some tasks, Dancer works for other tasks. Use the right tool for the right job."

Celebrate Intellectual Diversity


In reply to Re^2: Stackoverflow blog: Why Perl is still relevant in 2022 by InfiniteSilence
in thread Stackoverflow blog: Why Perl is still relevant in 2022 by NetWallah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2022-10-01 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?