You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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?
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
andvadd
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 andverbed
for copying - egnormalise
andnormalised
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.
The text was updated successfully, but these errors were encountered: