The internet has not been an unequivocal good for mankind but this is pretty great …


Adventures in Computer Programming – bakert@gmail.com
Sometimes you use a third party library and the interface is so well designed it’s just effortless. Something that would have been gnarly and murky becomes simple. The kind of library that gets ported to multiple languages because everyone wants access to it.
One slightly obscure example is feedparser, (originally) Mark Pilgrim’s python2 library for reading Atom and RSS feeds. Hiding all this nonsense:

behind a simple interface.
import feedparserd = feedparser.parse('http://www.reddit.com/r/python/.rss')print(d['feed']['title'])>>> Pythonprint d.feed.subtitle>>> news about the dynamic, interpreted, interactive, object-oriented, extensible programming language Pythonprint d.headers>>> {'content-length': '5393', 'content-encoding': 'gzip', 'vary': 'accept-encoding', 'server': "'; DROP TABLE servertypes; --", 'connection': 'close', 'date': 'Mon, 14 Oct 2013 09:13:34 GMT', 'content-type': 'text/xml; charset=UTF-8'}
Another library that has the same simplicity is Mustache logic-less templates. This one has been ported to literally dozens of languages. Every template I ever worked on was kind of a mess until I found Mustache. It’s actually the restrictions here that make it sing.
Hello {{name}}You have just won {{value}} dollars!{{#in_ca}} Well, {{taxed_value}} dollars, after taxes. {{/in_ca}}
Some other examples:
Do you know any “perfect” libraries?