Parse the JSON …

Following on from this morning’s lesson, Lesson 12 of CodeWithChris‘s Module 2 put the JSON techniques into practice.

Data has to come from somewhere and, whether that’s from a database or a flat file, it’s still just data. JSON ensures that the data is available/presented in a common standard format.

In many ways, this is what I’d been doing before with my own coding, except that the only person who knew how the data could be read was me. JSON is effectively a common standard so that anyone can use the data they have access to.

In your own code, this isn’t necessarily of primary importance. Just getting the data and presenting it is sufficient. But if you wish to obtain data from a third party source, then knowing it’s in JSON enables you to write code to access and display it.

Parsing is taking the data as presented (in JSON) and preparing it for whatever use you wish to put it to. In short, it replaces many individual and unknown (to others) with a common standard. Something we might have thought about decades ago if we ever considered the likelihood that people would share code, write for different languages, or access the same data source.