Why are String Formatted Queries Considered So Magical?

Ben Finney ben+python at benfinney.id.au
Sun Jun 27 23:33:23 EDT 2010


Carl Banks <pavlovevidence at gmail.com> writes:

> On Jun 27, 4:35 pm, Ben Finney <ben+pyt... at benfinney.id.au> wrote:
> > Carl Banks <pavlovevide... at gmail.com> writes:
> > > Seriously, almost every other kind of library uses a binary API.
> >
> > Except for the huge number that deal with text protocols or languages.
>
> No, not really.  Almost all types of libraries have binary APIs,
> including those that deal with text protocols or language.  Any
> control with string commands is something that's built on top of the
> binary API.

I don't know what you mean by this.

Are you referring to the operating system's function call API? It's
trivially true that the OS function call API is “binary”, but that
doesn't seem useful for distinguishing; by that definiition, SQL isn't a
“library API” at all. So I assumed you didn't mean that.

Rather, I was taking you to mean the network API used for communicating
with the server; and it's in that context that I'm saying there are a
huge number of text-based network APIs.

If that's not what you mean either, then I need you to explain.

> I'm disappointed, usually when you sit on your reinforced soapbox and
> pretense the air of infinite expertise you at least use reasonable
> logic.

Kindly stop inventing straw men to attack; I deny the position you're
painting for me.

> Also, I was asking about databases. "SQL is a text language" is not
> the answer to the question "Why do RDBs use string commands instead of
> binary APIs"?

To that question, I'd say that SQL isn't a library API, but rather a
network API and a command API, and is thus well implemented with textual
commands.

-- 
 \     “[W]e are still the first generation of users, and for all that |
  `\      we may have invented the net, we still don't really get it.” |
_o__)                                                   —Douglas Adams |
Ben Finney



More information about the Python-list mailing list