
Ask HN: In 2018, should we use SnakeCase or CamelCase for JSON? - xstartup
Last year, my friend got fired because he used SnakeCase instead of CamelCase for the startup&#x27;s API.<p>This year, yet another friend fired for doing the opposite.
======
randomerr
'camelCase' is the JavaScript standard. Since JSON is an extension of
JavaScript I would stick with that.

Ex. allTrue, charAt(), indexOf, ect.

Mozzila's JSON examples are in 'camelCase': [https://developer.mozilla.org/en-
US/docs/Learn/JavaScript/Ob...](https://developer.mozilla.org/en-
US/docs/Learn/JavaScript/Objects/JSON)

Microsofts's JSON examples are in 'camelCase': [https://msdn.microsoft.com/en-
us/library/hh923971(v=vs.85).a...](https://msdn.microsoft.com/en-
us/library/hh923971\(v=vs.85\).aspx)

------
mtmail
Clearly use whatever your boss tells you to use (otherwise you get fired).

------
bballer
My personal preference is to always use snake case, and not just for JSON but
for all javascript variables, while keeping all functions names as camel case.
Since javascript doesn't have type safety I find that it makes it super easy
when looking at code to quickly make a distinction of "is this a function or
is this a variable".

------
NVRM
Use unicodes instead!
[https://codepen.io/Nico_KraZhtest/pen/mEjBdj](https://codepen.io/Nico_KraZhtest/pen/mEjBdj)

