minwin
Walter Bright
newshound at digitalmars.com
Tue Nov 28 17:50:26 PST 2006
Bill Baxter wrote:
> The bottom line is, just because D doesn't have negative version checks,
> doesn't mean the need for them will go away. It just means that
> "version(X){}else"
> becomes the spelling of "!version". I'd personally rather see
> !version(X) or not_version(X) than version(X){}else.
Or perhaps rethink why there is a negative version called X in the first
place. For example, if you want:
version (!FULL) { }
it would perhaps be better to redo the version as:
version (EMPTY) { }
I've been through this with my own code, and it definitely improves the
readability to think in positive features rather than negative features.
Something about how human perception works. Long ago I read that there's
some research to back this up.
For example,
version (NOFLOAT) => version (INTONLY)
version (NOTWINDOWS) => version (LINUX)
More information about the Digitalmars-d-announce
mailing list