Fixing C's Biggest Mistake
H. S. Teoh
hsteoh at qfbox.info
Thu Jan 5 17:30:59 UTC 2023
On Thu, Jan 05, 2023 at 09:37:18AM +0000, areYouSureAboutThat via Digitalmars-d wrote:
[...]
> As for D, yes, it sure is surprising the compiler cannot automatically
> size a static array by the number of arguments being provided to it.
Of course it can. See std.array.staticArray.
Yes, yes, people hate the standard library for some weird reason. D must
be the only language where people actively hate its standard library.
It's like writing C without using stdlib or stdio, or writing C++
without using STL. Makes no sense.
Built-in syntax has been proposed multiple times in the past, the main
blocker being:
> But I'm not a fan of this syntax [..]
Everybody says that about every proposal that has come up.
// All this has been proposed before:
int[_] staticArray; // "but _ is a valid identifier!"
int[$] staticArray; // "but $ looks ugly!"
int[auto] staticArray; // "but auto is too verbose!"
... // the list goes on
// And now this:
int[..] staticArray; // "but i'm not a fan of this syntax!"
If we would stop bikeshedding over trivialities such as syntax, we'd
have implemented this years ago.
T
--
Notwithstanding the eloquent discontent that you have just respectfully expressed at length against my verbal capabilities, I am afraid that I must unfortunately bring it to your attention that I am, in fact, NOT verbose.
More information about the Digitalmars-d
mailing list