The FAQ mentions camelCase as the preferred case for variables. Bit of an edge case, but is there an existing convention for how acronyms should be handled? eg. is it spelt XMLHTTPRequest
, XmlHttpRequest
or xmlHttpRequest
? (or something else?) I'd expect xmlHttpRequest
, given how leading caps imply a type and xMLHTTPRequest
is likely universally offensive.
What's the analogous convention for types? XMLHTTPRequest
or XmlHttpRequest
? Looks like XmlHttpRequest
, going by Str.Utf8ByteProblem
.
Sorry, answered my own question while writing it :sweat_smile:
Should I add this to the FAQ?
yeah, should be XmlHttpRequest
- but we should write that up somewhere!
in fact that's a good example of exactly why this convention exists - the lowercase indicates word boundaries
e.g. with XMLHTTPRequest
you can't tell where one word ends and the next one begins :sweat_smile:
(unless you already know already, of course)
I'm guessing it would be paddingXY
instead of paddingXy
though since X and Y are separate words?
That's a good one too. All caps can be especially confusing when a type is all domain-specific acronyms, like EMVPOS
Richard Feldman said:
yeah, should be
XmlHttpRequest
- but we should write that up somewhere!
Is the FAQ the right place for this? Thinking of adding it where I found the camelCase recommendation ("No underscores in variable names" in the reasons Roc differs from Elm)
both of those sound good to me! as in: both the FAQ and the roc-for-elm-programmers.md document
want to make a PR for adding them?
Last updated: Jul 06 2025 at 12:14 UTC