Why version() ?
Sean Kelly
sean at invisibleduck.org
Tue Feb 10 17:28:50 PST 2009
== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
...
> Let's take an example, like the enum for O_XXXX in std.c.linux.linux.
> Some of those values are common between platforms, and some are unique
> to particular platforms. So you might be tempted to write:
[snip]
> The first version is definitely shorter. But is it easier to maintain? I
> argue that it is *harder* and *buggier* to maintain.
This is definitely true of header modules. There's absolutely no way I could
manage the Posix headers in Tango/druntime with the non-duplicating
approach.
> This would be even better if the OSX and linux declarations were split
> into separate "personality" modules. That way you can develop happily on
> OSX without fear of accidentally breaking linux support. You can defer
> dealing with the linux version until you actually on the linux machine
> and are in an efficient position to take care of it.
With version blocks, working with one version shouldn't break another
version anyway, unless I'm misunderstanding your point.
Sean
More information about the Digitalmars-d
mailing list