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

Consider replacing some member functions and operators with free functions #87

Open
Pharap opened this issue Mar 26, 2021 · 0 comments
Open
Assignees
Labels
Major This change is a major breaking change Quality This change improves the code's quality
Milestone

Comments

@Pharap
Copy link
Owner

Pharap commented Mar 26, 2021

Following the current style of not defining functions inside the main body of the class, this would mean that there would be fewer member functions kept inside the class.

This is considered 'breaking' because technically someone could be doing (for example) fixed.operator+=(value) somewhere in their code, which would break when operator+= is no longer a member function.

Anyone using the form fixed += value would be unaffected, and the fact that the vast majority of people are likely to be doing this is precisely why I have little concern about making this change.

However I will schedule this for the next 'breaking' change anyway, as a precaution. This change is more of an internal benefit than an external benefit, so it will most likely go unnoticed for the end user.

Typically there are other benefits associated with using free functions rather than member functions, but the primary driving force behind this change is the improved maintainability.

@Pharap Pharap added Major This change is a major breaking change Quality This change improves the code's quality labels Mar 26, 2021
@Pharap Pharap added this to the v2.0.0 milestone Mar 26, 2021
@Pharap Pharap self-assigned this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Major This change is a major breaking change Quality This change improves the code's quality
Projects
None yet
Development

No branches or pull requests

1 participant