Poll: Primary D version

bearophile bearophileHUGS at lycos.com
Sat May 22 14:04:35 PDT 2010


Adam Ruppe:

> I don't think that's a bug. It should only worry about converting, not
> filtering out bad stuff. That's an orthogonal problem that the other
> function does well, and easily too.

It's not a bug, right. But saying that there are other functions orthogonal to it that solve this problem is not enough. There is a balance you have to adopt between having a so flexible language/stdlib that's sloppy and can lead to bugs, and to have as much orthogonal functions as possible that are fussy and can lead to opposite kinds of bugs.

Very often if I have to convert strings to numbers I have leading or trailing spaces, often a leading newline. Converting such string to a number is not sloppiness because my experience shows me it can hardly cause bugs in general. The way to!() is currently designed forces me to remove the spaces often. This has caused a bug in one of my small script-like D programs. So if to!() will not strip spaces I'll have to define a stripping+conversion function in my dlibs2, and I'd like dlibs2 to be as small as possible.

Bye,
bearophile


More information about the Digitalmars-d mailing list