Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Capturing parenthesis and grouping square brackets

by Tanktalus (Canon)
on Jun 20, 2013 at 16:20 UTC ( [id://1040000]=note: print w/replies, xml ) Need Help??


in reply to Capturing parenthesis and grouping square brackets

BrowserUk: I don't know about Eily, but I type my regexes at 30-40wpm, I think that's close enough. Not that I'm entirely sure what your point is.

hdb: I've seen more than one less-than-entirely-joking proposal to localise perl-the-language. Without breaking existing code :)

rjt: Actual change, yes, has to be really good to justify breakages. But it doesn't have to be that good to simply provoke a discussion. Who knows, it might lead to a change that is good enough while not actually causing breakages. But to do that, people must listen to the pain points that any proposal is intended to address, not just the solution being proposed.

And, really, that's the point behind my response. I don't think Eily's suggestion will, or even should be, taken at face value. But the desire for laziness is valid. And comments pointing out how this is actually the lazy way for others are good counterpoints. But to focus on the proposal while ignoring the pain seems to me to be natural yet backwards. Looking to improve the language, even if that's solely out of newbishness (and I'm not sure that's the case here or not), is always deserving of a ++. Well, unless, I suppose, they aren't open to learning why their proposal may actually be counterproductive, if, indeed, that turns out to be the case (such as with this one, I think). Though I, too, use (?:...) a lot, I still think () as capturing is probably better than the reverse.

Replies are listed 'Best First'.
Re^2: Capturing parenthesis and grouping square brackets
by Eily (Monsignor) on Jun 20, 2013 at 23:39 UTC

    Thanks for the consideration. And while I'm not a Perl newbie, I just set my foot in the Perl community, and this was probably my first meaningful attempt at questioning a language I used. So no matter how foolish, I won't think it was a mistake, and I'd do it again in a heartbeat if I ended up going back in time. I just havn't found a Time::Machine module to do that yet.

    I do agree with BrowserUk on the point that the added keystroke for typing [ is not so much trouble though. Even if it significantly changed my typing time, it would not matter as much when compared to all the development time that does not involve any code-writing. I'm afraid this whole discussion comes from my failed attempt at poking fun at myself by pretending to propose a syntax change for my sole comfort, but I did get the answers I was expecting on my other points, so that's ok :)

Re^2: Capturing parenthesis and grouping square brackets
by BrowserUk (Patriarch) on Jun 20, 2013 at 16:56 UTC
    BrowserUk: I don't know about Eily, but I type my regexes at 30-40wpm, I think that's close enough.

    Sorry, but I do not believe you. Unless you make a frequent habit of copy-typing existing code.

    If the regex is so simple that you can mentally construct it at 30wpm(1), then it is so short that sum of the sub-second differences between typing Alt-Gr shifted-characters over a non-shifted characters will be less than the time taken to find the position in the code to type it.

    And if the regex is long enough for those sub-second differences to add up to anything substantial, no human being can formulate the regex in their head fast enough to supply their fingers at 30wpm. Nobody!

    Indeed, the same can be said (and proven) for all programming. Touch typist programmers may type short bursts(2) of 30-40wpm; but then they have to stop and think.

    Their actual rate averages out to something like 10-20 lines per day.

    Most of a programmers time is spent editing what exists not producing new; and in both cases, deciding what to type and where, is a such a huge proportion, 95-98%, of the total time, the speed the actual tokens are entered is totally inconsequential.

    (1What constitutes a 'word' in a regex anyway?)

    (2And in (informal) testing of 5 experienced programmers who were also touch typists, whilst they generated lines of code in short burst of speed (mostly less than 20 tokens/second), they also spent far longer than non-touch-typists going back and deleting/re-typing chunks, lines and whole sections as they realised they had used a bad name for a variable; or used a for loop where a while loop was better; or typed themselves into an algorithmic dead end.)


    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".
    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://1040000]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found