Skip to content

Philosophy

Eeo Jun edited this page Apr 16, 2015 · 3 revisions

Philosophy behind Proclib

Proclib like many other libraries, are designed with the sole purpose of making something easier to do for the user. Making something so beautifully simple that becomes powerful due to the ease of extensibility. The design goals behind Proclib:

  • Make everything as simple (to use) as possible.
  • Make it easy to extend. If you are having trouble extending your code, chances are that your users can't do it as well.
  • Write the dirty code so your users don't have to.
  • Safe and sane by default.
  • Make names and concepts that click.

Design decisions

proclib.api

This is a trick taken from Skyfield and Brandon's talk about API design and the decisions behind the Skyfield library. The idea is that there should be an explicit module that exports the public, easy to use user-facing API and being explicit, users know what they are importing when they do:

from proclib.api import *

Also it makes the startup time slightly faster and reduces a whole class of bugs known as cyclic imports. Or import hell. Whichever you prefer.

Pipe and Process classes

Again, this is another design "pattern", if you will, suggested by Armin Ronacher that we should Start Writing More Classes. The idea behind this is that we should have functions, but functions that do not hide away their inner workings into a monolithic, hard to extend piece of software. Quoting Armin:

I love concise APIs and I love such functions but these functions should be just helpers for the common case and not the sole API.

Clone this wiki locally