question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rename Vector3.sub to Vector3.subtract

See original GitHub issue

All other methods other than sub use full word (like add, normalize, random, divide, negate, multiply, distance).

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Yincognytocommented, Sep 10, 2022

@manake Currently in Three.js, the “default” is sub, and it has less letters than subtract, hence the latter being more “verbose”.

It isn’t an actual word in human English language, but that doesn’t matter much in computer languages, where the devs have the last say and they don’t have to necessarily conform to the constraints of the human language. Otherwise, Javascript would have replaced their similar substr with substring, parseInt with parseInteger, min with minimum, max with maximum and so on. Obviously, they didn’t, since they value background compatibility more, and it was the right call.

I’m not against the suggestion itself. I’m against such suggestions after lots of people got used to them. I’m against such suggestions not being handled all at once and in a final manner. I’m against such suggestions taking a pass instead of more important ones related to functionality. That’s all.

3reactions
Mugen87commented, Sep 10, 2022

sub is a valid acronym of subtract. I’ve seen sub() functions in other libraries as well so I think it should be clear for what it stands for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vector3#sub – three.js docs
Projects this vector onto a plane by subtracting this vector projected onto the plane's normal from this vector. # .projectOnVector ( v :...
Read more >
Scripting API: Vector3.operator - Unity - Manual
Subtracts one vector from another. Subtracts each component of b from a . // prints (-5.0,-3.0,-1.0) using UnityEngine; ...
Read more >
Issues · mrdoob/three.js · GitHub
Rename Vector3.sub to Vector3.subtract Suggestion. #24612 opened Sep 8, 2022 by manake · 18. AnimationAction wrapping on time === duration Needs ...
Read more >
Softimage User's Guide: Vector2 To Vector3 - Autodesk
Converts 2D vector input to 3D vector output. Name. The shader's name. Enter any name you like, or leave ...
Read more >
Customising Operators in Python - acroz
class Vector3(object): """ Describes a 3-vector. ... so simply renaming the method to __add__ will make additions of Vector3 objects work as intended....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found