4 ms·
My first question would be "what are you writing this social network in?" Because I think every mainstream language in existence has free libraries to create b
by TomOfTTB 17y ago
My first question would be "what are you writing this social network in?" Because I think every mainstream language in existence has free libraries to create both XML and JSON output (Javascript is made for it, .Net has WCF, there are several Gems for Ruby, php has _encode, etc...). So implementing both should just be a matter of passing the values to the appropriate function and reaping the benefits of already available libraries.
That in mind I'd say both. If for some reason you insist on choosing I'd probably say JSON. XML's only real advantage over JSON, imho, is it's human readability. That makes it great for stuff like configuration files. But for machine to machine communication JSON is faster and less prone to conversion errors. Plus it's easier to accept JSON in Javascript which you defined as your target audience.
- jacquesm 17y agoIt's strictly machine-to-machine, basically this is a way of extending the functionality of a website without having code server side, all the extension code runs on the browser of the end-user and talks to the server using the API. The server side code for the project is going to be in PHP. Think of it as HN on steroids, custom filtering and alternative user interfaces, tweaks and so on by adding chunks of javascript to the site, either just for yourself or if you think your stuff deserves a greater audience as a switchable plug in for others. If something is very well thought out we might make it default to 'on'. Greasemonkey allows you to do some of this for a single user, but you normally wouldn't have access to the 'raw' data that builds up a site, in this case you would, all the rendering comes from the javascript. Another part of the configurables is custom stylesheets. The general idea is that you can completely overhaul the front end of the site from a plug-in on the assumption that more than one person will want to make those changes we make those changes available to the rest of the users. I got the idea a while ago while browsing HN, it's one of the things that made me wonder how far you can push customization of a website and my conclusion is very far if you are willing to give up control. So the only criteria I would attach to public distribution of an extension would be that the extension is not malicious in intent. Beyond that it is 'anything goes'. A 'hackable' social network. Very simple in basis but extremely extensible.
- TweedHeads 17y ago"That makes it great for stuff like configuration files" Nothing beats YAML for configuration files. For everything else, use JSON.
- axod 17y ago>> "XML's only real advantage over JSON, imho, is it's human readability." You're obviously being sarcastic here.
- bayareaguy 17y agoXML's only real advantage over JSON, imho, is it's human readability. While there may be cases where this is true, I've never encountered any and I find this difficult to believe without some specific examples.