Prev: Anybody mind to translate this Felleisen quote from German to English
Next: Macros and anonymous functions
From: Michael Gardner on 27 Feb 2010 16:40 On Feb 27, 2010, at 2:08 PM, Ron Garret wrote: <snip> > And of course the regexp syntax is > much, much worse even than CL's format strings. Even Perl's supporters > will readily admit that Perl regexps are write-only. God help you if > you ever have to debug one. It boggles my mind that the same people who > complain about the aesthetics (or lack thereof) of parens in > S-expressions will accept something like this: > > (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\ > x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e > -\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]* > [a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]| > 2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e > -\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]) > > without batting an eye. I use both Perl and regular expressions frequently, and I would certainly "bat an eye" at a monstrosity like that. But then, I've never complained about Lisp's parentheses either. As for "read-only", maybe that applies to the mess above, but it certainly doesn't apply to most of the regexes I come across. The fact that one *can* write ridiculous regexes doesn't mean they're always or even usually used that way. -Michael
From: Zach Beane on 27 Feb 2010 18:21 Ron Garret <rNOSPAMon(a)flownet.com> writes: >> > There is no way to catch exceptions (which I learned the hard way >> > while managing a project that was using Perl in production). >> >> This is generally considered a feature of Perl. What aspect of Perl's >> support for catching exceptions do you feel disqualifies it per your >> definition of the term? > > I have to give you a bit of context: I was brought in as an interim CTO > in a situation where the actual CTO (and founder of the company) had > gone off the deep end and was pretty much bringing the company down. So > I was not (and never became) very familiar with the code base. All I > know is that there were a bunch of perl scripts in production, one of > which was failing intermittently for unknown reasons. I suggested that > we just wrap the entire script in whatever the perl equivalent of a TRY > block was so we could catch the error, whatever it was, and I was told > that was not possible. At that point I made a command decision to > rewrite the entire system in Python, which was well received by both > upper management and the engineering team, and not just because catching > errors ought to be a complete no-brainer in any reasonable programming > language. By this reasoning, Python can't catch exceptions either. Is that and its support of regular expressions a strike against Python? Zach
From: Ron Garret on 27 Feb 2010 19:04 In article <87aauumfi0.fsf(a)hangup.portland.xach.com>, Zach Beane <xach(a)xach.com> wrote: > Ron Garret <rNOSPAMon(a)flownet.com> writes: > > >> > There is no way to catch exceptions (which I learned the hard way > >> > while managing a project that was using Perl in production). > >> > >> This is generally considered a feature of Perl. What aspect of Perl's > >> support for catching exceptions do you feel disqualifies it per your > >> definition of the term? > > > > I have to give you a bit of context: I was brought in as an interim CTO > > in a situation where the actual CTO (and founder of the company) had > > gone off the deep end and was pretty much bringing the company down. So > > I was not (and never became) very familiar with the code base. All I > > know is that there were a bunch of perl scripts in production, one of > > which was failing intermittently for unknown reasons. I suggested that > > we just wrap the entire script in whatever the perl equivalent of a TRY > > block was so we could catch the error, whatever it was, and I was told > > that was not possible. At that point I made a command decision to > > rewrite the entire system in Python, which was well received by both > > upper management and the engineering team, and not just because catching > > errors ought to be a complete no-brainer in any reasonable programming > > language. > > By this reasoning, Python can't catch exceptions either. Huh? How do you figure that? > Is that and its support of regular expressions a strike against Python? No, because Python *can* catch exceptions, and regexps are not woven deeply into the fabric of its culture the way they are in perl. rg
From: Zach Beane on 27 Feb 2010 19:10 Ron Garret <rNOSPAMon(a)flownet.com> writes: > In article <87aauumfi0.fsf(a)hangup.portland.xach.com>, > Zach Beane <xach(a)xach.com> wrote: > >> Ron Garret <rNOSPAMon(a)flownet.com> writes: >> >> >> > There is no way to catch exceptions (which I learned the hard way >> >> > while managing a project that was using Perl in production). >> >> >> >> This is generally considered a feature of Perl. What aspect of Perl's >> >> support for catching exceptions do you feel disqualifies it per your >> >> definition of the term? >> > >> > I have to give you a bit of context: I was brought in as an interim CTO >> > in a situation where the actual CTO (and founder of the company) had >> > gone off the deep end and was pretty much bringing the company down. So >> > I was not (and never became) very familiar with the code base. All I >> > know is that there were a bunch of perl scripts in production, one of >> > which was failing intermittently for unknown reasons. I suggested that >> > we just wrap the entire script in whatever the perl equivalent of a TRY >> > block was so we could catch the error, whatever it was, and I was told >> > that was not possible. At that point I made a command decision to >> > rewrite the entire system in Python, which was well received by both >> > upper management and the engineering team, and not just because catching >> > errors ought to be a complete no-brainer in any reasonable programming >> > language. >> >> By this reasoning, Python can't catch exceptions either. > > Huh? How do you figure that? To demonstrate that Python doesn't have exceptions, all you have to do is join a project with a Python script that fails intermittently, suggest that it be wrapped in an exception handling block, and be told that it isn't possible. (It's not difficult to produce a Python script like that.) Then you can make a command decision to switch to Perl, which does support catching exceptions. Then you can write on a newsgroup that Python doesn't support catching exceptions. Zach
From: Ron Garret on 27 Feb 2010 19:27
In article <873a0mmd85.fsf(a)hangup.portland.xach.com>, Zach Beane <xach(a)xach.com> wrote: > Ron Garret <rNOSPAMon(a)flownet.com> writes: > > > In article <87aauumfi0.fsf(a)hangup.portland.xach.com>, > > Zach Beane <xach(a)xach.com> wrote: > > > >> Ron Garret <rNOSPAMon(a)flownet.com> writes: > >> > >> >> > There is no way to catch exceptions (which I learned the hard way > >> >> > while managing a project that was using Perl in production). > >> >> > >> >> This is generally considered a feature of Perl. What aspect of Perl's > >> >> support for catching exceptions do you feel disqualifies it per your > >> >> definition of the term? > >> > > >> > I have to give you a bit of context: I was brought in as an interim CTO > >> > in a situation where the actual CTO (and founder of the company) had > >> > gone off the deep end and was pretty much bringing the company down. So > >> > I was not (and never became) very familiar with the code base. All I > >> > know is that there were a bunch of perl scripts in production, one of > >> > which was failing intermittently for unknown reasons. I suggested that > >> > we just wrap the entire script in whatever the perl equivalent of a TRY > >> > block was so we could catch the error, whatever it was, and I was told > >> > that was not possible. At that point I made a command decision to > >> > rewrite the entire system in Python, which was well received by both > >> > upper management and the engineering team, and not just because catching > >> > errors ought to be a complete no-brainer in any reasonable programming > >> > language. > >> > >> By this reasoning, Python can't catch exceptions either. > > > > Huh? How do you figure that? > > To demonstrate that Python doesn't have exceptions, all you have to do > is join a project with a Python script that fails intermittently, > suggest that it be wrapped in an exception handling block, and be told > that it isn't possible. (It's not difficult to produce a Python script > like that.) Really? How do you do it? > Then you can make a command decision to switch to Perl, > which does support catching exceptions. It should be noted at this point that you are the one who introduced the concept of catching exceptions into the conversation, not me. What I was talking about was catching *errors*. Catching exceptions can be the same thing as catching errors but it might not be. And in particular, in Perl, I was given to understand that it is not, though I am certainly no Perl expert and I am always happy to be enlightened. rg |