-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Make Vectors immutable #188
Comments
An issue for ppb_vector, but yeah. I think that's a thing we should probably do. |
An issue for both. It's pretty easy on the ppb-vector side. Problem is making sure all the use in ppb conforms to it. |
What is the rationale for making vectors immutable? Why is it important? |
@ReblochonMasque I'm not sure what are the issues you are referring to (esp. in ppb itself), but the rationale is pretty simple: it's both convenient and efficient to reuse vectors (say, if you are teleporting a player to a location, Since ppb is an engine that focuses on ergonomics and learnability, it makes sense to simply avoid surprising behaviours such as this one. Especially when the only cases of mutation we could find where internal to the engine itself. |
okay, thank you! |
I already liked @nbraud's response, but to confirm: as the person who made the decision to make them mutable in the first place, the least surprise principle absolutely applies and is why I've been behind this change since shortly after it was suggested. |
Should we just make vectors immutable things? That seems like best practice?
The text was updated successfully, but these errors were encountered: