mikekelly / hal_specification

HAL Specification
http://stateless.co/hal_specification.html
619 stars 58 forks source link

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

Open redben opened 10 years ago

redben commented 10 years ago

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

mikekelly commented 10 years ago

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

redben commented 10 years ago

Obviously :)

mikekelly commented 10 years ago

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

mikekelly commented 10 years ago

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

ghost commented 10 years ago

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: {} }