Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

you could do {"name": {"first": "John", "last": "Smith" } } even for json there's multiple ways you could do it. You could also include the person like XML did, but oh well...


With JSON, there's still a culture of doing things the simplest possible way. Sure, it won't eliminate all the variability, but the lighter syntax makes needless complexity more obvious.

For instance, if you don't need to separate the first name from the last name, {"name":"John Smith"} is obviously simplest. If you need to, and you have few other parameters besides the name, the OP's solution is obviously simplest. If there are lots, or if the name itself is complicated (first, last, mother's maiden name, pseudonym…), then your solution is obviously simplest.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: