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

refactor: remove useless getter and setter functions #125

Closed
tcoratger opened this issue Nov 9, 2023 · 3 comments · Fixed by #128
Closed

refactor: remove useless getter and setter functions #125

tcoratger opened this issue Nov 9, 2023 · 3 comments · Fixed by #128
Assignees
Labels
good first issue Good for newcomers

Comments

@tcoratger
Copy link
Collaborator

tcoratger commented Nov 9, 2023

In our structures declared as public, the fields are public and therefore accessible from outside by default as described here:ziglang/zig#9909.

Also, as can be seen on reference repos such as the standard library, https://github.com/tigerbeetle/tigerbeetle or https://github.com/oven-sh/bun/tree/main, the culture of getters and setters is largely not present in the Zig community.

So, there are a lot of getter and setter functions that are useful in Rust because the fields are private which can be removed from our Zig implementation because useless.

Example of this:

https://github.com/keep-starknet-strange/cairo-zig/blob/0e61d828f16337fa4ee925aa7702806054cf03ab/src/vm/core.zig#L410-L429

@tcoratger tcoratger added the good first issue Good for newcomers label Nov 9, 2023
@0xicosahedron
Copy link
Contributor

can i try this one?

@tcoratger
Copy link
Collaborator Author

can i try this one?

@0xicosahedron Yes sure just assigned

Copy link

Issue closed and locked due to lack of activity.
If you encounter this same issue, please open a new issue and refer to this closed one.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants