Perché Bootstrap 3 cambia camelCase in trattini - è più leggibile?

20

Mi chiedo quale sia il ragionamento alla base della decisione di Bootstrap di cambiare tutti i nomi dei casi dei cammelli in nomi sillabati nella v3.0. Ho cercato su Google e ho cercato in alcuni libri, ma posso trovare le opinioni solo in un modo o nell'altro, senza dati concreti.

Ci sono studi che suggeriscono che i nomi delle variabili dei casi di cammello siano più leggibili dei trattini, o si tratta solo di preferenze personali?

    
posta Dan Blows 08.02.2013 - 17:23
fonte

1 risposta

27

Sto rubando Il commento di Robert :

There are lots of things in software design and development that are driven, not by the result of formal studies, but by convention and pragmatism. That's why defacto standards exist; they arise out of everyday use, and many people discovering over time what works and what doesn't.

Quando si tratta di scegliere tra camelCase e nomi con trattini, ciò è particolarmente vero, in quanto gli studi non sono conclusivi:

  • To camelCase o under_score - Dave Binkley, Marcia Davis, Dawn Lawrie, Christopher Morrell

    The study described in this paper shows that although those without training take longer to recognize identifiers in the camel case style, all subjects are more accurate when identifying a camel-cased identifier. In addition, subjects trained to use camel casing take less time to identify a camel-cased identifier than an underscore identifier.

    The next step is to consider higher-level tasks in more realistic settings. One task would investigate the impact of camel casing versus underscores when reading blocks of code. For example, subjects might be asked to search for a particular identifier. Another task would ask subjects to read natural language paragraphs modified to use camel casing or underscores. This would enable more direct comparisons with previous work done in psychology such as Epelboim et al.

  • Studio di eye tracking su camelCase e under_score Stili di identificazione - Bonita Sharif, Jonathan Maletic

    An eye-tracking study analyzing the effect of identifier style (camel-case and underscore) on accuracy, time, and visual effort is presented with respect to the task of recognizing a correct identifier, given a phrase. Visual effort is determined using six measures based on eye gaze data namely: fixation counts and durations. Although, no difference was found between identifier styles with respect to accuracy, results indicate a significant improvement in time and lower visual effort with the underscore style. The interaction of Experience with Style indicates that novices benefit twice as much with respect to time, with the underscore style. This implies that with experience or training, the performance difference between styles is reduced. These results add to the findings of Binkley et al.’s study. Future work includes conducting more eyetracking studies (with a larger subset of identifiers and larger subject sample), on reading source code consisting of both identifier styles, in the context of a specific task such as debugging. Another possible direction is to determine if there is an advantage for a programmer to change their current style to what is determined to be a better overall style.

    Nota: lo studio menzionato qui come Binkley et al. è il primo studio a cui mi sono collegato.

risposta data 12.04.2017 - 09:31
fonte

Leggi altre domande sui tag