Unity-Technologies / Unity-Technologies/Unity.Mathematics

On all-lower-case readability

Open
#91 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.4k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

Hi! I understand the naming convention of all-lowercase provides the benefits as described here. As a counter-balancing point, I just wanted to provide my impression that usability is lowered though when it comes to Unity usage like this

var jobHandle = Entities
    .WithName("RotationSpeedSystem_ForEach")
    .ForEach((ref Rotation rotation, in RotationSpeed_ForEach rotationSpeed) =>
        {
            rotation.Value = math.mul
            (
                math.normalize(rotation.Value),
                quaternion.AxisAngle(
                math.up(),
                rotationSpeed.RadiansPerSecond * deltaTime
            )
        );
        })
    .Schedule(inputDependencies);

... where now suddenly, functions are using different case rules. Generally, it's also harder to "parse" in your mind multiple words if they don't use camel-case, e.g. lengthsq contains both the plural "lengths" as well as the intended "length sq". Another stumbling block is generally to have some functions start with a lower-case (this flavor), and others with upper-case (classic Unity), as it makes it harder on the eye to understand what is a function during broad scanning.

Of course, those are just split-seconds reading stumbling blocks, but I'm having flashbacks to how the PHP language grew over time to make different functions use different underscore, case, or haystack-needle parameter ordering rules, increasing usability.

Again, I understand there are benefits to all-lower-case, so please just take it as it is, an impression from a developer, so you can better gauge the costs. The way you chose to do it may still be better in sum.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the naming convention linked in the issue and compare it with the Unity usage example, especially mixed casing and names such as lengthsq. Determine whether the concern calls for a specific naming change or only records usability feedback; done would require an agreed scope and maintainer decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.