Is str ~ regex the root of all evil, or the leaf of all good?

Ary Borenszweig ary at esperanto.org.ar
Thu Feb 19 08:45:36 PST 2009


bearophile wrote:
> Jarrett Billingsley:
> 
> This is an old discussion, and maybe it will not lead to much.
> 
> 
>> If you don't have a semicolon, you get a simple parser error. That is not a bug.<
> 
> Wikipedia agrees with me:
> 
> http://en.wikipedia.org/wiki/Software_bug
>> A software bug is an error, flaw, mistake, failure, or fault in a computer program that prevents it from behaving as intended (e.g., producing an incorrect or unexpected result).<
> 
> So a parser error is a bug too, despite the compiler will help you find it in a moment.
> 
> I have written and debugged many times "mistakes" like:
> 
> foreach (a, b, iterable)
> foreach (a; b; iterable)
> foreach (a; b, iterable)
> 
> And probably I am not the only one :-)

Why would you do that?

Many times when writing C# loops I do foreach(x; ...) and then remember 
it's "in" in C#, because I'm used to writing ";" in Java. I prefer ";" 
because it's shorter and you write a lot of foreach loops in a program.

Maybe we should vote and see how many people make the mistake of 
confusing comma and semicolon in this case.

> 
> 
>> If you can't tell ; and , apart, get a better font.<
> 
> I have already modified a good font to tell apart . and ; better when I program D:
> 
> http://www.fantascienza.net/leonardo/ar/inconsolatag/inconsolata-g_font.zip
> 
> But having a language that is more bug-prone isn't good.
> 
> 
>> That has little to nothing to do with it.  'in' in a foreach loop header is unambiguous to parse.<
> 
> You may have missed the discussion last time, when I think Walter has explained what I have told you the problem about the compilation stages.
> 
> 
>> and changing it to 'in' does not really benefit anyone except you, since you're so goddamned attached to Python's syntax.<
> 
> Thank you, I attach myself to things I think are good and well designed.
> And Python isn't the only language that uses "in" with a "for-each" :-)
> 
> 
>> Use Delight, ffs.<
> 
> I don't know what "ffs" means, and I'm on Windows again now :-)
> 
> 
>> Also, "I think I don't like X" is not proper English.  Say "I don't think I like X" or just "I don't like X" instead.<

To Jarrett: why isn't it proper English? It makes sense to me.



More information about the Digitalmars-d mailing list