Hi all,
Just wanted to share that we sent a survey out over social media and have now finished analyzing the results to help assess which naming option would be most appealing to people. Here are the results: https://docs.google.com/presentation/d/1c5aXrGD_3J2NlI9K2yFBd-GX1VBUwa4S0Vw5QPl-_0g/edit#slide=id.p.
The main findings
-
the majority of people prefer the naming that we currently have, e.g XmlHttpRequest.open()
.
-
We learned that adding .prototype, although it is technically correct, is verbose and more difficult to read, e.g. XmlHttpRequest.prototype.open()
. Adding “method” to the end is unnecessary because it is implied by ()
.
-
Devs tend to prefer to write in something to search for that matches what they tend to actually use in their code editor, so, not *.prototype.*
. We were told this multiple times over related twitter conversations we had when sending out the survey.
-
What they mainly assessed the naming options on were: clarity, closeness to actual code for ease of copy and paste, short and to the point, ease of scannability and accuracy/correctness.
##About survey participants
-
Most are professional developers.
-
Most feel that they understand what static methods and prototypes are.
Let me know what you guys think of the results or if you have any questions!
Next steps
We will proceed with recruiting a few developers to invite to do a usability test/interview to understand what their expectations are when they’re searching for such features.
We are wondering whether a solution would be to simply remove the dot from between the interface name and the member? So instead of
XMLHttpRequest.open()
we’d have
XMLHttpRequest open()
?
That would no longer be explicit incorrect syntax, so would no longer be a problem to Domenic and the other spec folks (?), but we’d have to test whether this would be disastrous in some other way (e.g. would it ruin SEO?)
If this is no good, is there any other alternative pattern that would please the spec folks as well as our main target audience?
Credits and further reading
Thanks to Shi Li for composing and running the survey.
The full unfiltered survey results are here: https://data.surveygizmo.com/r/28049_5be076be70cde8.17076831