mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Camelcase all keys #638

Closed lucaswoj closed 7 years ago

lucaswoj commented 7 years ago

Working with Mapbox style spec objects in Javascript is less ergonomic because all the dashcase properties must be quoted when they are used as identifiers.

var layer = { 'line-color': 'blue' }
layer['line-color']

vs

var layer = { lineColor: 'blue' }
layer.lineColor

They look odd in conjunction with the camelcased source properties #175

tmcw commented 7 years ago

Oof, that is one breaking change, but I support it 100%. We used dashes in CartoCSS too, from the CSS lineage, and in simplestyle-spec, and they're just inconvenient for no reason. This would also bring property names closer to what @1ec5 wants on the native side.

1ec5 commented 7 years ago

I have no opinion either way. Camel case is always applied systematically, so it poses no barrier to people developing against our Android, iOS, or macOS SDKs, where we’ve exposed symbolic constants or method names instead of requiring strings to be hard-coded (as JavaScript does). Besides, the Android SDK uses SCREAMING_SNAKE_CASE too.

lucaswoj commented 7 years ago

This issue was moved to mapbox/mapbox-gl-js#4163