Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^7: Get a known substring from a string

by flowdy (Scribe)
on Sep 14, 2016 at 19:03 UTC ( [id://1171762]=note: print w/replies, xml ) Need Help??


in reply to Re^6: Get a known substring from a string
in thread Get a known substring from a string

Good answer, I must admit. I acknowledge it, but it does not really convince me. It doesn't need to, either.

In my job, my code is known as "flowdy's way of Perl coding", because it is full of idioms, it is compact and created with efficiency in mind (clearly this is just my version of the story). To me, it is a compromise between resource usage of perl processing it and how quick I or a colleague of mine will get a clue of what it is supposed to do months later. Since I was said that my code is touched with awe and "Uh, let's leave him the maintenance", I have begun to think twice before getting fond of some new idiom like 1+index(...).

Idiomatic code is useful when it is intuitively understood by someone not as firm in a programing language. Otherwise, it might become a boomerang, especially when not used that often, and most especially if a considerable number of different idioms of that subtle kind is used. That boomerang might hit the employer so he regrets having hired you.

Only if a resource usage bottle-neck is significantly shown in benchmarks and there is a specific idiom to solve it, you are completely right. Then the use of the idiom outweighs any more thought needed for recomprehension.

Replies are listed 'Best First'.
Re^8: Get a known substring from a string
by BrowserUk (Patriarch) on Sep 14, 2016 at 20:16 UTC
    Idiomatic code is useful when it is intuitively understood by someone not as firm in a programing language. Otherwise, it might become a boomerang,

    That's a crock! No idiom -- and especially not the one you railed against -- would take any half competent programmer (in any language) more than 5 minutes to understand; even if they have to look up the documentation. (Woe & shucks; the idea that a maintenance programmer might actually have to reference the documentation.)

    Heck! It probably wouldn't take more than 15 minutes to post the code here and get a bunch of replies explaining chapter and verse.

    Only if a resource usage bottle-neck is significantly shown in benchmarks...

    And that is the biggest fallacy of all.

    Billions of pounds/dollars/sheckles have, and continue to be, wasted in government, defense and private enterprises, as entire projects and all the resources they've consumed, are scrapped; because performance was left as an afterthought and by the time it was considered, it was simply too late to restructure and recode the projects sufficiently to address the problem.

    There has, to my knowledge, only ever been one project that ran too fast; a software emulator that ran DOS era games under Windows on Pentiums, that ran so quickly, the games as originally coded, became unplayable.

    Every other project I have ever been involved in, be they on mainframes, minis, PCs or servers, be they processor-bound or IO-bound, batch or interactive, stand-alone or client server; I've never heard the users say: "Oh, could you make it run more slowly please". Whereas the opposite of that has, and continues to be, de rigueur across the 35+ years I've been programming commercially.

    The practice of first world programmers, valuing their time over that of their users; their convenience over that of their users; their programming quirks, affectations and dogmas over the efficiency of the code they produce, and the productivity of their users; is the height of arrogance, and a primary driver behind the rise of outsourcing to third-world coders.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-18 02:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found