hal_specification icon indicating copy to clipboard operation
hal_specification copied to clipboard

Any reason for having an underscore before "links" property ?

Open redben opened this issue 11 years ago • 5 comments

Not really important but why not just "links" without the underscore ?

redben avatar Sep 02 '14 16:09 redben

make it obvious it's a reserved property and reduce the likelihood of collisions with existing plain json representations that might be being replaced with hal

mikekelly avatar Sep 02 '14 16:09 mikekelly

Obviously :)

redben avatar Sep 02 '14 17:09 redben

haha, not really - it's a fair question. comes up a lot

mikekelly avatar Sep 02 '14 17:09 mikekelly

I'll reopen this, because the page should probably explain this more clearly

mikekelly avatar Sep 02 '14 17:09 mikekelly

FWIW, this is use of underscore to inject a dissimilar item into bag ... sort of clever, and sort of not.

Yes, we have a history of usage like this in C and Python (and others), but those choices were also driven by history.

Personally, I much prefer putting metadata beside the data, not mingled in. Like: { widget: {... widget fields ...}, some_metadata: {}, }

Not: { ... widget fields .... _some_metadata: {} }

ghost avatar Oct 06 '14 23:10 ghost