Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

can be a big weakness when it comes to Perl being used in a bigger team as you need to explicitly agree on how to do things when with Python or Java there is simply one obvious way
Agreed, with caveats about there being "simply one obvious way" in Python, as detailed below. It seems you and I are one of the "many" mentioned in John Wang's claim that "TIMTOWTDI is often cited as a strength but, taken to an extreme, it is also seen as a weakness by many".

I much prefer the Enlightened Perl Organisation alternative TIMTOWTDIBSCINABTE, pronounced "Tim Toady Bicarbonate":

There's more than one way to do it, but sometimes consistency is not a bad thing either

Python's TOOWTDI ("There should be one -- and preferably only one -- obvious way to do it") notwithstanding, I discovered that, in practice, Python sometimes provides more ways to do it than Perl!

As analysed in The golf course looks great, my swing feels good, I like my chances (Part VI), when considering how to create a "Dear John" string in each of the four languages (Perl, Python, Ruby, PHP) I could only see one obvious way to do it in Perl namely:

"Dear $name"
while in Python I found three:
"Dear %s" % expr # Python % printf-like operator "Dear {0}".format(expr) # Python format string method "Dear "+`expr` # Python backticks (TIMTOWTDI)

And from the classic 99 bottles of beer golf, when changing between "Take one down and pass it around" and "Go to the store and buy some more" - shortening the two strings above to "Take" and "Go to" for clarity - let's consider the many and varied ways of doing this in Python (TIMTOWTDI):

"Take"if n else"Go to" (n>0)*"Take"or"Go to" ["Go to","Take"][n>0] ("Go to","Take")[n>0] n and"Take"or"Go to" "GToa kteo"[n>0::2] # "Slice and Dice" wins this golf!
Admittedly, the winning Python slice and dice golf solution can hardly be described as obvious. :) As you can see, playing golf in Python is fun because there is more than one way to do it!

Curiously, code golf is more popular in Python than Perl nowadays. See The golf course looks great, my swing feels good, I like my chances (Part IV) for evidence.


In reply to Re^11: Curious about Perl's strengths in 2018 by eyepopslikeamosquito
in thread Curious about Perl's strengths in 2018 by Crosis

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 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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found