Unity-Technologies / Unity-Technologies/Unity.Mathematics

On all-lower-case readability

Offen
#91 2 Kommentare 5 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C#
Sterne
1.4k
Forks
159
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der im Issue verlinkten Namenskonvention und vergleiche sie mit dem Unity-Verwendungsbeispiel, insbesondere hinsichtlich gemischter Groß-/Kleinschreibung und Namen wie lengthsq. Ermittle, ob das Anliegen eine konkrete Namensänderung erfordert oder lediglich Feedback zur Nutzbarkeit festhält; als abgeschlossen gilt die Aufgabe, wenn Umfang und Entscheidung der Maintainer vereinbart sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
developer-experience
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.