C locale

Walter Bright newshound2 at digitalmars.com
Fri Sep 27 21:29:34 PDT 2013


On 9/27/2013 7:18 PM, "Luís Marques" <luis at luismarques.eu>" wrote:
> My point here is not to argue against your choice for the
> standard library. My issues of version(X, Y) arose in client code
> (non-lib), where it seems to me that the second kind of bug is
> probably more likely to occur than the first kind. So, I politely
> ask, are you sure the language should not support something like
> version(X, Y), for cases where developers think that it is a
> better trade-off than multiple version() blocks?

I understand your point and reasoning, and it has come up repeatedly.

It's not obvious why, but that feature (in C and C++) leads to wretched, 
unmaintainable, buggy, coding horrors. You don't have to take my word for it - 
do a grep for #if across some C or C++ code that's been maintained by multiple 
people over a period of years.

I include the source code of dmd itself as a (bad) example of #if hell. I've 
gone to some effort to beat that disease out of the front end, but like 
barnacles on a boat, they always come back and threaten to sink the ship. The 
back end is far worse.

There are other ways of doing versioning that do not have this result, and I 
recommend giving them a chance long before reaching for this particular one.



More information about the Digitalmars-d mailing list