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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 12 03:04:19 UTC 2019


On 4/11/19 10:29 PM, Walter Bright wrote:
>> Creating functions like `isOdd` or `GetLeastSignificantBit` help 
>> convey intent without having to supplement code with comments.
> 
> No they don't. For example, if I saw "isOdd" in code, I'd wonder what 
> the heck that was doing. I'd go look up its documentation, 
> implementation, test cases, etc., find out "oh, it's just doing the 
> obvious thing", and be annoyed at the waste of my time.
> 
> It wastes the time of everyone reading the code, documenting the 
> function, and the QA staff. It hides the useful stuff in the library 
> when it's alongside a morass of junk like this. It wastes the time of 
> the poor shlub perusing the library. It makes the library look like a 
> bunch of filler rather than useful stuff.
> 
> I don't believe anybody's code is so well-documented that this is all 
> that's left. Meaning you're wasting your time documenting the wrong things.
> 
> I call this sort of stuff the "Illusion of Progress".

Very well put.

Funny tidbit: "% 2 == 0 appears 63 times in the Apple/Swift repository." 
That argument is quoted straight from the proposal. Of course, they 
conveniently neglect to mention that the project has over 2.4 MILLION 
lines of code. That's 0.002625% or better put 26 ppm. IF there's an 
argument in there, it must be of a homeopathic nature.

The day we talk ourselves into entering the ilk of isOdd and isEven into 
the standard library someone please slip me that misericorde.


More information about the Digitalmars-d mailing list