Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: why are hex values not numbers?

by eyepopslikeamosquito (Archbishop)
on Sep 28, 2016 at 10:21 UTC ( [id://1172824]=note: print w/replies, xml ) Need Help??


in reply to Re: why are hex values not numbers?
in thread why are hex values not numbers?

I think you should investigate why the substr built-in is named "substr" and not "substring", "subStr", "subString", "sub_str", "sub_string" or any of a large number of other possibilities.
Alas, even the shortest of these (substr) is way too long to be competitive at code golf. As a golfer, I wish Perl had used a built-in operator rather than the substr function for string slicing. This is one of the very few areas where Python trounces Perl at code golf, as discussed in detail at Re: Drunk on golf: 99 Bottles of Beer.

Quite apart from golf, I miss Python's concise and powerful string slicing operator when coding in Perl and feel string slicing is a common enough operation to warrant a very short "Huffman-coded" way to do it -- especially given "things that are commonly used should be shorter/more succinct" is one of Larry's language design principles. I also find it odd that Perl supports built-in array and hash slices, but not built-in string slices.

Replies are listed 'Best First'.
Re^3: why are hex values not numbers?
by Your Mother (Archbishop) on Sep 28, 2016 at 13:50 UTC

    I quite agree with your reasoning and conclusion. That said, substr is one of the Perl functions I use the least; uncommonly, on par with things like getpwuid, at least for me.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1172824]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found