You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me preface this with that I believe I know what Void is. It just doesn't make any sense.
As far as I can tell, Crystal's use of Void, is essentially to integrate with C where the type is not really known, or doesn't need to be known. Typically seen when using Pointers to some unknown or undefined object.
But the problem here is that the name itself "Void" does not agree with this context. It lets the user believe that what they are working with is actually empty, untouched, or perhaps even Null.
Void in C is to indicate that a function actually does not return any value at all. Not that it returns some unknown value, or does something unknown. It means that it is literally nothing, not even empty, not unknown, and not Null.
The type Void in Crystal needs to be changed to something that makes more sense as to what it contains. Perhaps Unknown?
Maybe I am just misunderstand Void altogether and I am just a Crystal noob. I have been programming for the last 9 years, and 3 of them with Crystal, and I still cannot wrap my head around "Void" in Crystal as it doesn't make any sense.
The text was updated successfully, but these errors were encountered:
Crystal itself essentially has no actual Void type. In Crystal, it's just Nil. Void is only used for C bindings and Void pointers. For C bindings the name is obviously correct, because it's C terminology.
Outside of C bindings, Void should not really be useful and we should restrict its usage even further (see #10657), perhaps even removing it entirely (except for bindings) with a UntypedPointer type as replacement for Pointer(Void) (#10749).
I knew that Void was not a Crystal type, wasn’t trying to say that it was. But I did not realize that void pointer was a thing in C. I guess that’s where my complaint belongs, with the C language.
I think UntypedPointer much better explains what a void pointer is, than “void pointer”
Let me preface this with that I believe I know what Void is. It just doesn't make any sense.
As far as I can tell, Crystal's use of Void, is essentially to integrate with C where the type is not really known, or doesn't need to be known. Typically seen when using Pointers to some unknown or undefined object.
But the problem here is that the name itself "Void" does not agree with this context. It lets the user believe that what they are working with is actually empty, untouched, or perhaps even Null.
Void in C is to indicate that a function actually does not return any value at all. Not that it returns some unknown value, or does something unknown. It means that it is literally nothing, not even empty, not unknown, and not Null.
The type Void in Crystal needs to be changed to something that makes more sense as to what it contains. Perhaps
Unknown
?Maybe I am just misunderstand Void altogether and I am just a Crystal noob. I have been programming for the last 9 years, and 3 of them with Crystal, and I still cannot wrap my head around "Void" in Crystal as it doesn't make any sense.
The text was updated successfully, but these errors were encountered: