Final by default?

Walter Bright newshound2 at digitalmars.com
Thu Mar 13 12:01:13 PDT 2014


On 3/13/2014 6:23 AM, Daniel Murphy wrote:
> This is one of the few areas where D is idealistic instead of pragmatic.

Nope. It's a very pragmatic decision.


> This reminds me of banning goto and multiple returns because 'structured
> programming' prevents goto spaghetti madness.  As always, it simply forces the
> programmer to jump through more hoops to get what they want.

I've seen some of those hoops programmers have done to get that behavior in D, 
and it resulted in just what I predicted - confusing bugs due to wacky 
dependencies between modules.

Bluntly, if your code requires more than version(Feature) you are doing it wrong.

I haven't yet seen an example of boolean version expressions that made the code 
clearer, simpler, or more maintainable than version(Feature).

I've seen endless examples of boolean version expressions that are a rat's nest 
of unmaintainable, buggy, confusing garbage. I've made a major effort to remove 
all that garbage from dmd's source code, for example, and am very pleased with 
the results. There's still some in druntime that I wish to get refactored out.

And yes, I'm pretty opinionated about this :-)


More information about the Digitalmars-d mailing list