Solving the impossible?
Everlast
Everlast at For.Ever
Wed Aug 29 19:56:31 UTC 2018
On Tuesday, 28 August 2018 at 22:01:45 UTC, Paul Backus wrote:
> On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote:
>> Also, the biggest complaint is that when we use [] attached to
>> a type it has a specific meaning as "an array of". e.g., int[]
>> means an array of int's.
>>
>> But int[] a... then changes as we don't have an array of int's
>> any more but simply a sequence of ints. While internally it
>> might not matter it just doesn't jive with normal type syntax
>> IMO.
>
> The parameter `int[] a...` is an an array of ints just like any
> other `int[]` in D. If you don't believe me, see for yourself
> here: https://run.dlang.io/is/IJdovg
>
> I understand that the syntax does not align with your
> expectations. Instead of complaining about it, I would urge you
> to set your preconceptions aside and learn D with an open mind.
> You'll be less frustrated, more productive, and more successful.
One of the things that makes a good language is it's internal
syntactic consistency. This makes learning a language easier and
also makes remembering it easier. Determinism is a very useful
tool as is abstraction consistency. To say "Just except D the way
it is" is only because of necessity since that is the way D is,
not because it is correct. (There are a lot of incorrect things
in the world such as me "learning" D... since I've been
programming in D on and off for 10 years, I just never used a
specific type for variadics since I've always use a variadic type
parameter)
To justify that a poor design choice is necessary is precisely
why the poor design choice exists in the first place. These are
blemishes on the language not proper design choices. For
example, it is necessary for me to pay taxes, but it does not
mean that taxes are necessary.
More information about the Digitalmars-d-learn
mailing list