food for thought - swift 5 released - bottom types, string interpolation, and stuff.

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Wed Apr 17 07:08:21 UTC 2019


On 4/13/19 4:38 AM, Abdulhaq wrote:
> On Saturday, 13 April 2019 at 05:37:31 UTC, Walter Bright wrote:
>> On 4/12/2019 10:18 PM, H. S. Teoh wrote:
>>> writing (x % 2) conveys intent much better
>>> than (x & 1).
>>
>> They produced different code.
> 
> This is a non-sequitur, the fact that some compilers produce different 
> assembly does not say anything about how well the functions convey intent.

That may be so, but it *does* very clearly demonstrate the value of 
specifying intent rather than implementation.

As with any abstraction, the separation here of intent vs implementation 
frees the code/programmer who needs to check parity from needing concern 
themselves with which implementation is optimal. This is the whole point 
of HLL-abstractions.

That is demonstrably relevant in this case *because* the two possible 
implementations produce different code.

Again, this is basic HLL Programming Abstractions 101.


More information about the Digitalmars-d mailing list