Stream: implementers
Topic: code conventions
Erich Schulz (May 17 2016 at 05:45):
I'm making up (sorry) some codes for "referal type" - what is most standard for multi word codes? snake_case or camelCase? ("assume management", "provide care")?
Erich Schulz (May 17 2016 at 05:46):
(for machine readable forms obviously)
Grahame Grieve (May 17 2016 at 06:12):
no spaces. I'd use lowercase with - between them
Erich Schulz (May 17 2016 at 06:13):
thanks - a dash? not an under_score?
Grahame Grieve (May 17 2016 at 06:21):
yes. but it's purely convention/style - except for avoiding spaces which is to avoid whitesapce trouble
Erich Schulz (May 17 2016 at 06:25):
whitespace is evil
Erich Schulz (May 17 2016 at 06:25):
cool - i'm just more used to _ than - as an alternative but keen to choose "the usual"
Rob Hausam (May 17 2016 at 14:20):
yes, underscore is pretty common generally, but FHIR has adopted dash as the convention (don't know of a particular reason why we did that, but it seems reasonable stylistically)
Erich Schulz (May 17 2016 at 22:20):
great - I'm glad I asked! looks like dropping a hyphenated code through _. startCase()
gives me a human friendly form (I had to check) so I'm a happy camper. https://lodash.com/docs#startCase
Last updated: Apr 12 2022 at 19:14 UTC