-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
rename String => AbstractString #8872
Conversation
+1 |
1 similar comment
+1 |
Seems like this would pave the way for a Just want to once again suggest that we could have |
I disagree: I think that numeric abstract types like |
I agree with Stefan there. I think a prefixing convention only speaks to an absence of appropriate names. Actually very few names in Base use the |
It's funny that this will be the most breaking change in 0.4 so far... |
3e28d85
to
5a25360
Compare
I'm going to merge this as soon as Travis is green since this is clearly an improvement and with the const alias it isn't breaking. I've been enjoying using the name |
Thanks to @ivarne for the |
What's going to be the upgrade path for code that wants to work with both 0.3 and 0.4? Should compat contain an alias from String to AbstractString for 0.3.x? |
For now, no action needs to be taken but yes, that's what we should do. |
😄 Happy to be useful (at least until I start disliking my own suggestion).
Edit: Sorry for the wrong mention |
rename String => AbstractString
no problem @ivarne (this was worth reading in any case) |
I have to say that after a couple of months of this I'm really not enjoying typing I don't remember ever being confused about whether Can we revisit this choice? (It reminds me of the array+scalar thing in #5810: reasonable in principle, endlessly annoying in practice.) |
|
@nalimilan, making several similar naming choices arguably reduces confusion. Unless you are proposing to rename Furthermore, type declarations are most commonly used for function arguments. And for function arguments it is usually better to accidentally undertype (since there is no performance penalty) than to accidentally overtype. The problem I have is that it is easy to remember to write But the basic argument is that shorter names for common things are better, as long as the abbreviations are clear, and the abbreviation |
Currently you cannot be consistent with both the So the consistency argument can only hold if we choose one rule and stick to it... I think this discussion already started somewhere, though I don't remember on which issue/PR. |
@nalimilan, the point is that the abstract vs. concrete confusion argument works both ways since we already have both conventions in Julia, so basically your only argument cancels out. What remains after this cancellation is that:
|
This seems like a pretty big improvement in the intention of the
AbstractString
type. It also clears the path for using theString
name for the standard string type, i.e. a future replacement for bothASCIIString
andUTF8String
.