minwin
Walter Bright
newshound at digitalmars.com
Wed Nov 29 11:15:30 PST 2006
Anders F Björklund wrote:
> Chris Miller wrote:
>
>> I like how D simplified this. It makes it much easier to do a general
>> parse of a source file without having to follow imports (which can be
>> a pain - e.g. several import dirs).
>
> Simpler for the parser, I guess. But harder for the user, unfortunately.
> (since you have learn and make changes with more than one tool/language)
> But once one gets the build system in place, it should be all good...
> (i.e. instead of doing a config.h file, it can generate a commandline)
I believe it is harder for the initial programmer, but much simpler for
the maintenance programmer. Have you ever been faced with maintaining a
piece of C code with complicated #if statements, and you have no idea if
FOO is defined or not, or what it is #define'd to? You've got to look at
the module, the freakin' command line, the makefile, the #include path,
every freakin' #include file, which of course use more #if's to
optionally #include other freakin' files, and such #defines are even
created using freakin' complicated token pasting!
Not allowing versions from one module to affect imports of it is a major
boon to maintenance and discoverability of the code. It requires
rethinking of how to organize building multiple versions from the same
source. The best way I've found is to abstract the version differences
into an API, and then have the different implementations of those APIs
in different modules.
More information about the Digitalmars-d-announce
mailing list