Ask HN: What open source project, in your opinion, has the highest code quality? I'm planning to study a number of these codebases to gain insight and inspiration. Maybe even write an article about their commonalities... |
Ask HN: What open source project, in your opinion, has the highest code quality? I'm planning to study a number of these codebases to gain insight and inspiration. Maybe even write an article about their commonalities... |
> The reliability and robustness of SQLite is achieved in part by thorough and careful testing. As of version 3.23.0 (2018-04-02), the SQLite library consists of approximately 128.9 KSLOC of C code. (KSLOC means thousands of "Source Lines Of Code" or, in other words, lines of code excluding blank lines and comments.) By comparison, the project has 711 times as much test code and test scripts - 91772.0 KSLOC.
Plus they have a whole page on their site about testing [1]. Which is more then you can say about a lot of open source projects.
I would suggest starting with qmail and looking at the (very mainstream) patches that people are running on top of it.
tinydns is also worth a look.
import requests
body = requests.get('http://pycurl.io/')
Getting a resource with libcurl: import pycurl
from io import BytesIO
buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.URL, 'http://pycurl.io/')
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()
body = buffer.getvalue()We're literally in the business of building on the work of others. Avoiding libcurl seems like an incredibly naive choice to me.
I'd guess: because distributing packages with native dependencies is sort of a a pain, and was way worse in the past, especially cross-platform, and thus python-only packages are preferred. Leaves open why libcurl bindings weren't choosen for stdlib.
And while the requests library might be shorter/easier, it doesn't offer nearly the guarantees that it will exhibit the expected behavior nor the feature flexibility that libcurl does.