Which D features to emphasize for academic review article
Adam Wilson
flyboynw at gmail.com
Sun Aug 12 13:49:52 PDT 2012
On Sun, 12 Aug 2012 03:38:47 -0700, Walter Bright
<newshound2 at digitalmars.com> wrote:
> On 8/11/2012 7:30 AM, Jakob Ovrum wrote:
>> On Saturday, 11 August 2012 at 09:40:39 UTC, Walter Bright wrote:
>>> Of course it is doing what the language requires, but it is an
>>> incorrect
>>> diagnostic because a dead assignment is required.
>>>
>>> And being a dead assignment, it can lead to errors when the code is
>>> later
>>> modified, as I explained. I also dislike on aesthetic grounds
>>> meaningless code
>>> being required.
>>
>> It is not meaningless, it's declarative. The same resulting code as now
>> would be
>> generated, but it's easier for the maintainer to understand what's
>> being meant.
>
> No, it is not easier to understand, because there's no way to determine
> if the intent is to:
>
> 1. initialize to a valid value -or-
> 2. initialize to get the compiler to stop complaining
>
>
>> I do, however, believe that D programmers are perfectly capable of
>> doing the
>> right thing if informed.
>
> Of course they are capable of it. But experience shows they simply don't.
>
>
>> Consider `pure` member functions - turns out most of them are actually
>> pure
>> because the implicit `this` parameter is allowed to be mutated and it's
>> rare for
>> a member function to mutate global state, yet we all strive to correctly
>> decorate our methods `pure` when applicable.
>
> A better design would be to have pure be the default and impure would
> require annotation. The same for const/immutable. Unfortunately, it's
> too late for that now. My fault.
>
>
>> Java exception specifications have widespread implications for the
>> entire
>> codebase, while the difference between '0' and 'float.nan' is constant
>> and
>> entirely a local improvement.
>
> I believe there's a lot more potential for success when you have a
> design where the easiest way is the correct way, and you've got to make
> some effort to do it wrong. Much of my attitude on that goes back to my
> experience at Boeing on designing things (yes, my boring Boeing
> anecdotes again), and Boeing's long experience with pilots and mechanics
> and what they actually do vs what they're trained to do. (And not only
> are these people professionals, not fools, but their lives depend on
> doing it right.)
>
> Over and over and over again, the easy way had better be the correct
> way. I could bore you even more with the aviation horror stories I heard
> that justified that attitude.
As a pilot, I completely agree!
--
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
More information about the Digitalmars-d
mailing list