4 ms·
Yes. I run a Python server, so there's conflict between "long_name" and "longName", and even "long-name" (which I think is semantically superior). I'm curious t
by mcav 17y ago
Yes. I run a Python server, so there's conflict between "long_name" and "longName", and even "long-name" (which I think is semantically superior). I'm curious to hear how other people have approached encoding multi-word values in JSON and XML.
- jashkenas 17y agoRight, and then HTML/CSS ids and classes further muddy the waters. It's usually worth keeping at least your model attributes with the same name, from DB column through Web App to JS. So we do: doc.set({related_article : 'http://...'}); Even though you might have: doc.openRelatedArticle(); As a method on the JS model. Definitely less than ideal.
- IgorPartola 17y agoFor me, data passed from server to client is encoded as long_name. The reason here being that I name database columns long_name and thus propagating this structure all the way down makes sense. Most other things are camelCased, except local_variables.
- sh1mmer 17y agoWhy not write a function that does it automagically and then forget about it?
- ableal 17y ago> "long-name" (which I think is semantically superior) except if you're trying to subtract: c = a-b which is why languages with arithmetic don't allow '-' in variable names. (Then function/method names get the same rule. KISS.)