From: Just Another Victim of the Ambient Morality Date: 2006-07-29T04:55:06+09:00 Subject: Re: Slow regular expressions :( "Alexandru E. Ungur" wrote in message news:20060728124227.GA8607@globalterrasoft.ro... >>>> sender: "Michael W. Ryder" date: "Fri, Jul 28, 2006 at 07:30:11PM >>>> +0900" <<> What's wrong with people wanting to improve a language? > > Nothing. In this case however we are not talking about improving, > but about making the regexp engine to be more forgiving, so that > we can be less careful when crafting a regex. So, you're against "defensive programming?" Routines that check their input for bad values are not an improvement over their earlier counterparts that would just crash, because forgiveness won't teach you a lesson? Are you against "memory protection" because a program should crash and take the whole system down with it instead of being forgiving of people's mistakes? Are you against "microkernels" because drivers should crash and halt the system and automatically restarting such sub-systems is just too forgiving and would hide the problem? > I wouldn't prefer Ruby to think for me, and I very much like when > it says: " - You moron, look what you did: I'm gonna stay stuck on > this regex for 56783.99 years, and all because of you!! Can you > even wait that long?!?" so that slowly I become less of a moron... > I would definitely not like it to say: " - All is good, feed me crap, > I can take it. I have a good stomach.", and let me go away with it. > But maybe that's just me... I think you misunderstand the purpose of programming. Programming languages are not a yard stick to measure the length of your member. This is not a contest and it's not a tutorial on regular expressions and how they work. Why don't you want Ruby to think for you? That's the role of a computer... to do work for you! I wish I could just talk to Hal, my computer, describe to it what work I want done and then have it do that work! But no, computers are still primitive, and we must do most of the thinking for it. However, we do try to get it to do as much work as possible, including catching our mistakes and optimising our code! Believe me, removing an exponential search pattern from my regular expression counts as an optimisation! Ruby halting is not Ruby saying "You moron, look what you did." That's Ruby sulking in a corner, not doing the work I (thought I) asked it to, and not telling me what's wrong. > I'm not against evolution, I just see it differently. I don't think you see it at all. Pretend, just for a moment, that you don't care if you're "right" or "wrong" and think about both sides of the issue. Think about the purpose of computers and think about the pros and cons... A little off topic but here's another property of Ruby I'd like to change. I didn't realize I wanted this until just the other day, so it remains interesting to me... array.each { |i| new_var = i if i.some_test } a_method.do_thing new_var # variables leak out of blocks!