|
|
|
|
|
by peterwwillis
2582 days ago
|
|
This is part of the code-as-docs ethos which has really changed how I write everything. I try to make my code as intuitive as possible to obviate comments and documentation that only explain what the code is doing. You could also call it code-as-prose. This is impeded when languages have popular modules with names that are absolutely unintuitive, like the Python "requests" module. Requests what? Oh, HTTP? Then it should have been called http_requests. And the module that one uses, urllib3, is actually an HTTP library, not a generic URL library (URLs can be any web request, such as ftp, mailto, jdbc, etc). |
|
Python has httplib since 2.7. Also urllib in 3.7 contains all of the URL parsing routines, too.
Naming is a hard problem, so frankly I would prefer if names did not try to mimic their corresponding protocols in the first place at all.
It gets even worse when you would like to support HTTP and async HTTP; then HTTP/2, HTTPS, HTTP server, etc... Which one of these libraries are supposed to be actually called "http"? What if there's two libraries with the same functionality?
urllib? Well, yeah - simply because someone wanted to provide a simple HTTP interface. By the way - urllib also provides FTP/local file access routines. So it does mean "a library to access URLs".