New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor Inconsistency String#bytes vs Bytes type #3551
Comments
An array is usually more useful as it's mutable and it's a copy of the underlying string bytes. If you want the bytes as a slice for performance reasons you can use |
I mean, if somebody eventually introduces, say, a Also the docs say: "Returns this string's bytes as an Array(UInt8)" |
@asterite There's also |
I don't understand, we also have |
When working with @asterite Ruby for instance does return an Why is I don't have a strong preference either way, I just think it would be better if they are consistent. |
I was kind of against the
|
I found If it is renamed to |
thats why i vote for name Binary :) |
A better name for this could be |
I'm closing this, this is a minor consistency, and I'm sure there are many more bigger inconsistencies throughout the language. It's really impossible for a language to be 100% consistent. |
To clarify the method, it could be |
Shouldn't the
String#bytes
method, return aSlice(UInt8)
instead of anArray(UInt8)
?The text was updated successfully, but these errors were encountered: