3 ms·
Maintenance matters. The C++ standard library provides some data structures you shouldn't use. OK, not some, C++ stdlib provides almost exclusively data structu
by tialaramex 5y ago
Maintenance matters. The C++ standard library provides some data structures you shouldn't use. OK, not some, C++ stdlib provides almost exclusively data structures you shouldn't use. But hey, the C++ language itself has some data structures you shouldn't use too (arrays especially).
However, Python's standard library is stuck with urllib, although these days they have the courtesy to tell any poor fool looking at the documentation that Requests exists, if you do use the standard library you get very primitive HTTPS handling, and so many wrong defaults.
Because these standard libraries have so many users, Hyrum's law means that you have to work very hard to fix anything.
- bsder 5y agoExactly. Just look at the mess that is the C++ String. This, of course, causes everyone to roll their own String, which is probably almost as bad. So, now we have a zillion String libraries, all of which suck. All because the C++ standard library doesn't provide a decent String.
- blub 5y agostd::string is not a mess, it's a good general string implementation which should suffice for many applications. Its only sin is perhaps that it does not support Unicode. If you look for example at other implementations like fbstring, the main benefit is performance.
- uranusjr 5y agoI think in urllib.request’s case (urllib.parse is fine albeit arguably with a cluncky API) it’s not they need to work very hard to fix it, but the task is impossible. My understanding is that bundling SSL validation in the Python stdlib is a lost cause since Python is updated way too infrequently and the stdlib cannot be easily changed once a Python minor version goes EOL, so they just gave up. If there’s anything Hynum in here, it’s they have their hands tied from removing the module entirely.
- Abishek_Muthian 5y ago> although these days they have the courtesy to tell any poor fool looking at the documentation that Requests exists Added up with "And when your project scales, Replace asyncio with uvloop, Coroutine with gevent, http.server with gunicorn and everything else with a cython based alternative". Or personally I just say 'Use go instead' to someone who's just getting into programming for developing a project which could potentially scale.
- blub 5y ago"C++ stdlib provides almost exclusively data structures you shouldn't use" The containers according to [1] are array, vector, deque, forward_list, list, *set, *map, stack, queue and priority_queue. All of these are good general implementations that can and should be used for most C++ software. Some classes of software require better performance or certain special guarantees and then it makes sense to consider specialized implementations. [1] https://en.cppreference.com/w/cpp/container https://en.cppreference.com/w/cpp/container