Coldfusion's SerializeJson Sucks!
If I recall correctly CFML is a typeless language. I mean we can really all agree that Coldfusion is typeless right?
Ok now that we have that out of the way lets talk about Adobe's implementation of serializejson(). Serializejson is simply trying to be too damn smart for its own good.
Listen I don't want you to frig with my data, I want you to take my structured data, be it query, structure, or array, or whatever, and simply convert that structure into its JSON equivalent. Don't try to parse my dates, numbers or what not, or even try to. Just take what I give you and simply covert the data from one structure to the other mmmkay?
Since when is 9999999999999999E+10 equal to 9.999999999999999E25. Ok mathematically they are, but did I ask you to be smart and do math? NO, I don't think I did!
Either provide me with enough options that I can influence how numbers and dates are handled or do what Railo does and output everything as strings.
/rant off

Subscribe
Subscribe via RSS
Follow me on Twitter
Or, Receive daily updates via email.
Tags
adobe air ajax apple cf community cfml coldfusion examples ext flash flex google javascript jquery max2007 max2008 misc open source programming railo software technology ui
Recent Entries
No recent entries.
Blogroll
An Architect's View
CFSilence
Rey Bango
TalkingTree

It's a trickier beast than you imply it is. If you look at the way some other languages are handling it, you can see that it is not as simple as just saying doWhatIThinkYouShould().
I've had to go back to CFJSON (http://www.epiphantastic.com/cfjson/) for a number of projects, especially anything that needs to respond consistently across multiple versions and vendors of CF.
maybe its your expectations that are wrong?
Maybe instead of ranting about the CF way of doing things sucks you could write an additional post a) outlining which CF setup you run and b) why exactly CF is not doing right in your opinion. Maybe a bunch of test cases, scenarios in code.
Cheers
Kai
http://www.city32.com/www.kamloops.kijiji.ca/