At lunch today there was some discussion about Flash and something about the layers of abstraction in the Flash player API. I was in too much of a food coma to catch the details but it all ended with, "Well of course it needs to transmit data in XML."
As if no serious buisiness can take place without data being converted to and from XML.
On one of my side projects, django-elsewhere, an open source Django plug-in for managing a list of social network profiles, I ran into a similar issue. I've been maintaining a list of known social networking sites in a Python file. Since renaming the project (Django-PSN to Django-elsewhere) and moving it to GitHub, there's been much fussing about what sites should be included in the list.
So why not just move the data into a database?
SQL databases are great for large amounts of data or data that gets updated often. To me, it didn't make a lot of sense to store a near-static list of social networks in a database. I outlined my thoughts in a GitHub comment:
Sadly, I'm going to lose this battle (in fact I've already lost). Why?
Because Python lists don't feel right.
Databases, YAML files, and XML feel right.
As good programmers, we've been trained to love standards and compatibility. Why, when anticipating working only in one language, can't we just use the data structures of that language to store data?
I really love that Django project settings are, by default, stored in a file called settings.py.
settings dot PY!
A Python file!! It makes perfect sense, use Python data structures to store data only used by a Python application. It's easy to read and manipulate, all in Python. I'm sure there was a bit of "why not use YAML?" with regards to the settings.py and cheers to it remaining in Python.
So yes, I think it's okay to have internal APIs pickle and external APIs only do JSON. Feel free to dispute in the comments but I say: know your audience, know your application, and sometimes it's okay to feel wrong.