Unity-Technologies / Unity-Technologies/Unity.Mathematics

On all-lower-case readability

Aperta
#91 2 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
1.4k
Fork
159
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la convenzione di denominazione collegata nell’issue e confrontala con l’esempio di utilizzo di Unity, in particolare per quanto riguarda la combinazione di maiuscole e minuscole e nomi come lengthsq. Determina se la questione richiede una modifica specifica dei nomi o se registra soltanto feedback sull’usabilità; il lavoro sarà considerato concluso quando saranno concordate la portata e la decisione dei maintainer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
developer-experience
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.