Skip to content
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 bytesavailable (née nb_available) to nbytesavailable #25659

Closed
wants to merge 1 commit into from

Conversation

ararslan
Copy link
Member

In #25634, nb_available was renamed to bytesavailable. However, it was noted that the n provided an important distinction, so this PR adds it for clarity, thus renaming bytesavailable to nbytesavailable.

This is technically a breaking change, code eagerly updated in the last few hours since #25634 was merged will get an UndefVarError from bytesavailable. I can add a defensive second deprecation if necessary.

@ararslan ararslan added breaking This change will break code io Involving the I/O subsystem: libuv, read, write, etc. deprecation This change introduces or involves a deprecation labels Jan 20, 2018
@StefanKarpinski
Copy link
Member

I don't really buy the need for the n – If it returned the bytes it would be called availablebytes instead of bytesavailable. Documenting that this returns the number of bytes and not a vector of bytes seems quite sufficient to me.

@JeffBezanson
Copy link
Member

No strong opinion here. Either is fine with me.

@ararslan
Copy link
Member Author

I also don't really care, but the proponents of n seemed to have a fair bit of support.

@nalimilan
Copy link
Member

We seem to use the n prefix everywhere when a function returns a number of things, so why not here?

@bicycle1885
Copy link
Member

If it returned the bytes it would be called availablebytes instead of bytesavailable

The n prefix would be a more explicit way to indicate that. Just adding a single byte is the simplest way and we already accept the convention in Base.

@bramtayl
Copy link
Contributor

bramtayl commented Jan 21, 2018

I wonder if there could be a list somewhere of "ok" abbreviations in Julia like number_of_ -> n. Even I'm willing to admit that number_of_available_bytes is a bit of a mouthful.

It was noted that the `n` provided an important distinction, so this PR
adds it for clarity.
@ararslan
Copy link
Member Author

Correct me if I'm wrong, but I don't think there's any strong opposition to adding the n; there seems to be mostly support and indifference. If that's the case then I think we should just go ahead with this. Is anyone actively opposed to adding an n?

@StefanKarpinski
Copy link
Member

I don't really like the n in this name, but perhaps I'm the only one.

@bramtayl bramtayl mentioned this pull request Jan 22, 2018
@JeffBezanson JeffBezanson added the triage This should be discussed on a triage call label Jan 23, 2018
@JeffBezanson
Copy link
Member

Triage is fine without the n.

@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Jan 25, 2018
@ararslan ararslan deleted the aa/nbytesavailable branch January 25, 2018 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code deprecation This change introduces or involves a deprecation io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants