For what it’s worth, I don’t think lowercasing the type enum collection was a great idea. I get how it happened: Zig convention for enums used to be uppercase, and now it’s lowercase, this brings the Type union into alignment with that convention.
But Types Are UpperCase Already. So it isn’t at all weird that the enums of types were uppercase also, and frankly it just makes work for people on what amounts to aesthetic grounds.
But it’s a done deal, and I did not and do not see the point in a futile burn of social capital complaining about it. I see the other side of the argument, I wasn’t there when it was decided, and “amounts to aesthetic grounds” goes both ways.
However, I don’t think that changing how the field and enum rules work is a useful thing to do, on its own merits. Furthermore it is a bizarre overreaction to use this particular change as grounds for that one.
I don’t think your opinion that this is some sort of disaster which will put people off from the language will prove to be a widely shared one.
When you express yourself this way:
You’re using language which assumes the conclusion you would like others to draw. Every user of a language is forced to do what the language does or it won’t compile. I’m forced to type try array.ensureUnusedCapacity(1)
if I want to ensure that the array has at least one slot of unused capacity. Everything is like this. If I had wanted in 0.13 to switch on @typeInfo
and use .int
, well, I would have been forced not to.
Aesthetically, yes, I see the point you’re raising. This:
switch (some_typeinfo) {
.int => ...,
.float => ...,
.@"struct" => ...,
}
It is not aesthetically regular. It isn’t smooth. It has a weird thing about it.
But I am baffled by the force of your conviction that this represents some existential threat to Zig’s existence, that newcomers to the language will be repelled and flee in disgust. I just don’t see it that way. I see it as a minor detail that people will instantly grasp and move on from. I would anticipate at least as much “oh cool you can use anything as an identifier with an @"string"
huh, neat” as “hmm that doesn’t look nice”, and approximately no existential horror and staunch refusal to ever touch the language again.