I'm quite new to programming so I apologize if the answer to my question is obvious:
I need to pass data between MySQL and an iOS app. I'm using php as the go between. The query result that I get via php I'm just passing to my app as a comma-separated/new line separated (comma for new column, new line for new row of data).
I keep reading about JSON and I've read (stackoverflow question on why json and it's associated links) to try and figure out why I would convert my php output into JSON format and then deserialize? on my app side. I keep reading how JSON is very light weight etc. but when I look at it, it seems like I would end up sending so much more data.
ex. if I'm sending some vehicle data:
JSON for 2 vehicles: [{type:'car',wheeles:4,wings:'no'},{type:'plane',wheeles:24,wings:'yes'}]
Same info in csv: car,4,no[/n] plane,24,yes
Of course there are no headers in the csv, but I know that the info will come as type,wheels,wings sending it again and again I would think the total number of bits sent would be a lot more.
My questions are: 1. Would sending the CSV be faster than the JSON string (I think the answer is yes, but would like to hear from the Pros) 2. Given that it is faster and I know the order the data is coming in, is there any reason I should still choose JSON over CSV (some form of robustness of the data as JSON vs. CSV or something else)?