I was going to title my previous entry "why are people dumb?" but I thought I might give some sort of benefit of the doubt to the client, taking their reasons at face value and assuming it made some sort of sense on some level even if I disagreed with it.
So, I thought I'd look into it. Maybe I am missing something obvious.
They had gotten the idea for the return data format from the Bing maps API. They told me that's how Microsoft does it, so that's how we're going to do it. Ostensibly this was to keep things consistent, to somehow make things simpler for the front end designer;though as he explained further he seemed to believe it was somehow necessary to define Javascript variables in this fashion in order to find the data.
I let it go. The customer is always right, or something like that.
But after looking at the data returned from Bing, using the wonderful Firebug extension, and comparing it to the JSON data we're now returning, I noticed two small problems. First, our data does NOT look like the Bing data; and two our data does NOT look like the Bing data. I realize that technically speaking that's only one problem, but it's such a big one that I thought it was worth mentioning twice.
And by big I mean, its not a big deal to format the data this way (its just redundant and less efficient); its a big deal because they are trying to emulate something they clearly do not understand but think they do. They also clearly do not understand JSON or Javascript.
We're returning strict JSON data, while Bing is returning Javascript code. So now, what we have as JSON data: {"Return" : ... } is their interpretation of the Bing API: function 123456778() {return: }.
Now, I don't know exactly why Bing is doing what they are doing. Perhaps they have good reasons. It seems bad to me, but what do I know? Well I do know that we are now implementing something dumb, based on a wrong interpretation of something that very well might be badly implemented itself (do we really want to emulate a Microsoft way of doing things?). Thats just dumb.