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 current_span_len() to something better #685

Open
dvdsk opened this issue Jan 22, 2025 · 4 comments
Open

rename current_span_len() to something better #685

dvdsk opened this issue Jan 22, 2025 · 4 comments

Comments

@dvdsk
Copy link
Collaborator

dvdsk commented Jan 22, 2025

we should rename current_span_len() to samples_left_in_span() or something better. The current name sounds like the length is fixed, it can however be called at any time and then should returns the samples left until the resample rate and/or channel count can change. That is better communicated by having the word "left" in the name. Adding the word "samples" to the name makes it clear its not the number of frames.

Originally posted by @dvdsk in #684 (comment)

@PetrGlad
Copy link
Collaborator

PetrGlad commented Jan 23, 2025

Yes, It makes sense. Ideally this should be counted in frames, not samples, but that requires rewriting algorithms, including ones that users may already have...

Could it be remaining_span_samples?

@dvdsk
Copy link
Collaborator Author

dvdsk commented Jan 23, 2025

Could it be remaining_span_samples?

for me samples_left_in_span is clearer, what do you like about remaining_span_samples? Yet another alternative would be samples_remaining_in_span.

@PetrGlad
Copy link
Collaborator

I would not insist on this option. Just hoped that there is something that is more concise. Identifiers do not need to be proper phrases.

@dvdsk
Copy link
Collaborator Author

dvdsk commented Jan 23, 2025

Identifiers do not need to be proper phrases.

I find code more readable when they are, but I do not know if there is consensus on that. Ill have to look into best practices for variable naming. If I find any we can make that a guideline for the project. Only if we both agree it of course.

@dvdsk dvdsk changed the title rename current_span_len() to samples_left_in_span() rename current_span_len() to something better Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants