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

vec2 and vec3 interface is not friendly #8

Open
1bardesign opened this issue May 12, 2020 · 2 comments
Open

vec2 and vec3 interface is not friendly #8

1bardesign opened this issue May 12, 2020 · 2 comments

Comments

@1bardesign
Copy link
Owner

At the moment, the vector modules have a naming pattern which is fairly user unfriendly. This is affecting uptake.

There are two issues, both basically lead to "hungarian style" names which are hard to understand at a glance.

Type Prefix:

Problem:
Currently, the operation type (scalar or vector) is specified with a "hungarian notation" style single letter prefix.
This avoids type dependent dynamic dispatch and keeps code fast but also is pretty unfriendly to a beginner.

Fix:
fully specified names could be provided for each operation, with hungarian style aliases preserved for writing terse code if preferred. vector_add and vadd both available, but the former canonicalised as the initial definition.

Immediate/Modifying Suffix:

Problem:
Currently, if an operation modifies its operand or not is specified with an "immediate" suffix on the method, eg vaddi for "vector add immediate". This looks a lot more like an assembly instruction than a lua method 😄

Fix:
A different naming convention could be adopted. Current candidate is verb for modifying and verbed for copying - eg normalise and normalised for modifying and copying normalisation respectively.

Note that this would break existing code. It definitely needs to be communicated well to existing users!

I do think both are worth doing though to make the incredibly useful vector modules more likely to get use in the wider community.

@1bardesign
Copy link
Owner Author

Done vec2 as of 918c943 - feedback welcome, will need to find some time to do vec3.

@1bardesign
Copy link
Owner Author

vec3 still needs doing

I've been underwhelmed when using vec2 honestly and find myself using the shorthand quite often. Other users have said they found it nicer though so probably a win?

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

No branches or pull requests

1 participant