FHIR Chat · code conventions · implementers

Stream: implementers

Topic: code conventions


view this post on Zulip 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")?

view this post on Zulip Erich Schulz (May 17 2016 at 05:46):

(for machine readable forms obviously)

view this post on Zulip Grahame Grieve (May 17 2016 at 06:12):

no spaces. I'd use lowercase with - between them

view this post on Zulip Erich Schulz (May 17 2016 at 06:13):

thanks - a dash? not an under_score?

view this post on Zulip 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

view this post on Zulip Erich Schulz (May 17 2016 at 06:25):

whitespace is evil

view this post on Zulip 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"

view this post on Zulip 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)

view this post on Zulip 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