[Edu-sig] teaching about privacy

kirby urner kirby.urner at gmail.com
Fri Dec 12 22:08:17 CET 2008


Here's a way of giving students more of a sense of Python's "privacy layers".

We're obviously drawing on experience with signage, various
prohibitions likely already tuned in, e.g.:

http://www.flickr.com/photos/17157315@N00/3051792354/

Here's the diagram:

class Snake:

  def __init__(self):
      # birth method, use triggering syntax:  newsnake = Snake()
      pass

  def _DontTouchMe(self)
      # authorized personal only (for maintenance, janitorial, internal use)
      pass

  def __YouShouldntHaveDoneThat(self)
      # keep out:  actively discourage tourists, outsiders
      pass

For those into American history, there's also this connotation (thanks
to the snake imagery):

http://images.google.com/images?gbv=2&hl=en&safe=off&q=%22don%27t+tread+on+me%22

However, we should balance these strident (commanding) remonstrations
with simple reminders about *why* we might want privacy.

A lot of it has to do with retaining developer freedoms to change
implementation, without changing the "user experience" i.e. the API,
i.e. the "exposed" or "exported" methods are safe to rely on, but we
have "under the hood" code we might want to rip out and replace, not
the business of our clients.

Privacy protections communicate where it's important *not* to "put
your weight" e.g "place a dependency" on something.

In cartoon terms, we might show a rickety bridge over a ravine, like
in Indiana Jones:

"Not safe to put your full weight on this board" is another meaning of
__KeepOff.

"Snake as potentially live wire" might be a good way to package this
meme (curriculum segment).

We also need to explain about munging (mangling).

Kirby


More information about the Edu-sig mailing list