Final by default?

Walter Bright newshound2 at digitalmars.com
Fri Mar 14 10:45:54 PDT 2014


On 3/14/2014 1:51 AM, 1100110 wrote:
>> Actually, very little of that.
> I don't know what you'd call this then...
> Exact same bit of code, repeated multiple times for versions which could be OR'd
> together.

I don't call it code duplication.

The code may look the same, but it is NOT. Arbitrary similarities between 
sections of code that are disparate is not code duplication.

The values are magic numbers specific to particular platforms, and should be 
treated as such. They are not common code between platforms. I know what always 
happens (including in druntime) when this sort of "duplication" was eschewed - 
one value would get "fixed" for platform X, and then platforms Y and Z silently 
broke.

Every time.

(It's also not code duplication because only one branch of the versions ever 
winds up in the executable, never multiple branches.)


More information about the Digitalmars-d mailing list