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

bearophile bearophileHUGS at lycos.com
Thu Feb 19 08:07:16 PST 2009


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 :-)


>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.<

Thank you very much, I'll try to remember that.

Bye,
bearophile



More information about the Digitalmars-d mailing list