Skip to content

Refactor: Rename helper function for consistency #12649

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Haisom
Copy link

@Haisom Haisom commented May 11, 2025

Description of Changes

  • Renamed 'IsMemoryCardFolder' to 'FileMcd_IsFolder' for better consistency and clarity on MemoryCardFile.cpp.

Rationale behind Changes

  • Consistency and clarity

Suggested Testing Steps

  • Not needed

- Renamed <IsMemoryCardFolder> to <FileMcd_IsFolder> for better consistency and clarity on MemoryCardFile.cpp.
@RedDevilus
Copy link
Contributor

Isn't FileMCD the variable and the helper function more on regular English?

Not sure if that is better, and are you referring to consistency with other places?

@Haisom
Copy link
Author

Haisom commented May 11, 2025

Every function inside MemoryCardFile.cpp is named "FileMcd_", so I thought it would also apply for that.
But if a helper function is intended to be named like regular english then this should be just ignored and closed.

@Mrlinkwii Mrlinkwii requested a review from RedPanda4552 May 12, 2025 13:35
@RedPanda4552
Copy link
Contributor

I'll leave this for others to decide, but the reason names are all over the place here is because memory card code is all over the place. The code is organized in this weird way where MemoryCardFile ends up being both the implementation of a file memory card, as well as the abstraction layer for all memory cards. MemoryCardFolder then is just the implementation of a folder memory card. So when something needs a different implementation it needs to be made in both sources, but if not then it can just go in MemoryCardFile. But the abstraction layer functions (at least many of them) still start with FileMcd because, well no one knows really, as far as I know at least.

@Haisom
Copy link
Author

Haisom commented May 12, 2025

I'll leave this for others to decide, but the reason names are all over the place here is because memory card code is all over the place. The code is organized in this weird way where MemoryCardFile ends up being both the implementation of a file memory card, as well as the abstraction layer for all memory cards. MemoryCardFolder then is just the implementation of a folder memory card. So when something needs a different implementation it needs to be made in both sources, but if not then it can just go in MemoryCardFile. But the abstraction layer functions (at least many of them) still start with FileMcd because, well no one knows really, as far as I know at least.

Well, in case it helps, I tried looking for it in whole solution and there were only 3 references.

image

However, if it's true that helper functions should be named as it is, then no change is needed and I should update the one I PRed for the memory cards swapping from 'FileMcd_IsAutoEjecting' to 'IsMemoryCardAutoEjecting'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants