OpenBSD port of dmd?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 16 18:37:47 PDT 2012


On 3/16/12 8:16 PM, Daniel Murphy wrote:
> "Andrei Alexandrescu"<SeeWebsiteForEmail at erdani.org>  wrote in message
> news:jk0naq$257e$1 at digitalmars.com...
>>
>> But why duplicate doItSlowWay(); which may be an arbitrarily long
>> sequence?
>
> If duplicating that block is a problem, there are other ways to do it.
[snip]

This is in the same vein: "let's avoid else".

>> This seems to accomplish little more than "well I didn't use else".
>>
>> Again: what exactly is wrong with specialization?
>>
>
> The advantage is, that when you write the code, you have _no idea_ what
> platform/os it might need to run on in the future.  You _cannot_ know which
> version is most appropriate for _all_ new platforms, or even if any of them
> will work at all.

Oh yes I do. Often I know every platform has e.g. getchar() so I can use 
it. That will definitely work for everyone. Then, if I get to optimize 
things for particular platforms, great. This is the case for many artifacts.

> The only time to make this decision is when implementing
> support for a specific platform, and this pattern forces you to consider
> each place where platform specific behaviour is required.  When doing things
> like this, 100 false positives are much faster to fix than a single false
> negative causing wrong code/corruption.

I just find it difficult to get convinced about this. Walter has often 
talked my ear off about this dogma and never produced a convincing argument.


Andrei


More information about the Digitalmars-d mailing list