On Wed, Mar 12, 2014 at 3:01 AM, Antoine Pitrou <solip...@pitrou.net> wrote: > Yes, why use a library when you can rewrite it all yourself? > Actually, you should probably issue system calls to the kernel directly, > the libc is overrated (as is portability, I suppose).
It's a trade-off, of course. I am fluent in over six million forms of TCP socket communication (give or take), so I'll often skip the libraries and just directly connect a socket. But on the flip side, some protocols are just way more convenient to let a library handle. An HTTP POST request, for instance, requires - potentially - a whole lot of escaping and merging and stuff, or a simple call to one function with a dictionary of form data. But I like to retain close familiarity with the actual protocols, in case I'm trying to transfer a file onto a target system that provides something buggy or incomplete... most notably, the innumerable platforms whose FTP clients don't support passive mode. (RFC 959 specified it in 1985, why doesn't the default WinXP client support it??) I've written a good few FTP clients for that reason. There's a huge difference between something meant to do a huge amount of work long-term and something to just quickly move some data across a VM boundary. For the latter, I'll do whatever's quickest *right now*, and that may well mean "don't bother figuring out the XYZ module, just do it over a plain socket". ChrisA -- https://mail.python.org/mailman/listinfo/python-list