Simon Griffee
Department of graphic design, art direction, and photography.

EuroPython 2013 Notes

Published 2013 July 2

Rough notes from EuroPython 2013.

The Next 20 Years of Python — V. Van Lindberg

Chairman of the Python Software Foundation, works for Rackspace and OpenStack.

Thinking Outside the Box — Armin Ronacher

Creator of the Flask framework and the Werkzeug and Jinja2 libraries among many others

We all suffer from going with the flow in many cases.

The keynote gave some examples of how questioning some established rules revolutionized the industry and how we open our mind a bit.

It included interesting examples from the Python and programming community where people tried something new with tremendous success and how they came up with the idea.

The Return of Peer2Peer ComputingHolger Krekel

Founder and co-developer of a number of popular Python projects, among them PyPy, py.test, tox and execnet. Regularly gives talks at conferences as well as open courses and in-house trainings on testing topics. His interests also include P2P computing, metaprogramming and politics.

A video of this presentation is now online.

Consider myself from global IT community, not from a particular nation

@gonzohacker:

Someday when I’m living in a post-apocalyptic police state, run by autonomous flying drones, I want to tell my kids, “I helped build that.”

How much is Google, Facebook, etc. responsible for aiding Spying Cartel?

Which Internet Future do we prefer:

  1. Greatest freedom catalyst ever?
  2. Greatest surveillance machine ever?

Which one happens depends on:

IT people are like bishops. We know how programming works and relates to society. We have a responsibility to make choices that cause no harm. It’s all about communication between devices, mediated by technology.

Centralization (current situation)

  0   0
   \ /
0 — 0 — 0
   / \
  0   0

Espionage Cartels are happy:

  1. Communication mediated by few companies.
  2. Companies can be compelled to co-operate with government.
  3. Weak or no end-to-end encryption == BIG PROBLEM.

How to disrupt Cartels?

Decentralization

    0 — 0 — 0   0 — 0
   / \ /    |  / \ /
  0 — 0 — 0 — 0 — 0
 /      |    /
0       0 — 0

Example: http://crypho.com, but: crypho as mediator has meta-data == PROBLEM

P2P code needs to be FOSS & run on OWN device.

Example: TAHOE-LAFS storage:

Communication is about more than only file storage. New promising WC3 standard: Web RTC - browser-to-browser data streaming, real-time communications.

With power comes abuse

We are good at client/server, not so much P2P"

Global WLAN situation is idiotic. Idiotic == private ‘only for me’ in ancient greek

Lookup:

Given enough time, looking at history, countries are in danger of having criminals in charge.

It’s about Convenience. Some choose inconvenience (Edward Snowden).

¿Q: Is there hope for a world without nation states?

Yes. FOSS is transnational. WebRTC standard - nations had no say. Nations not so important in internet world.

How do we do mediation?

It would make much more sense to have government communications open and transparent as they have nothing to hide, right?

Answer to the “If you have nothing to hide, you shouldn’t worry about surveillance” argument: The damage from a totalitarian society is much higher than from terrorists.

“Good Enough” is Good Enough!Alex Martelli

Alex Martelli in Florence in 2013.

Alex Martelli in Florence in 2013.

Author of Python in a Nutshell and the first 2 editions of the Python Cookbook. For the last 8+ years has been working (as ‘uber’ tech lead and senior staff engineer) for Google in Mountain View, California.

“Worse is Better” —Unix, ‘New Jersey’ approach.

Well == Simple.

G.K. Chesterton:

Anything worth doing is worth doing badly.

E. Raymond:

Given enough eyeballs, all bugs are shallow.

Perfection == Big Design Up Front.

Alex Martelli:

The world is changing all the time. Your perfection is a memory of the past.

Use ‘Perfect’ as Verb, rather than adjective.

Don’t save on:

No cowboy coding!

From the start:

Best at start, but acceptable to add later:

General vs ad-hoc solution

def find_by_col(root, color):
    if root.color == color: yield root
    yield from (find_by_col(c. color) for c in root.cs)
def find_by_sha(root, shape):
    if root.shape == shape: yield root
    yield from (find_by_sha(c. shape) for c in root.cs)

Versus:

def find(root, n, v):
    if getattr(root, n) == v: yield root
    yield from (find(c, n, v) for c in root.cs)

Okay to incur technical debt, WITH CARE.

Focus on potential errors that could cause irrecoverable losses:

Solid Python Application Deployments for Everybody - Hynek Schlawack

Hynek Schlawack is an infrastructure and software engineer from Berlin, Germany, PSF fellow and contributor to a wide variety of open source projects.

How a German web hosting company and domain registrar deploys numerous Python applications on UNIX-based systems. Simple is not Easy. Put effort into making your deployments simple.

Edsger W. Dijkstra:

Simplicity is prerequisite for reliability.

Donald Knuth:

It is important to find simple solutions instead of stopping as soon as a first solution is found.

Links:

Introduce Django to Your Old Friends - Lynn Root

Lynn Root is a software engineer at Red Hat on the Identity Management team. She is the founder and leader of PyLadies San Francisco, an international mentorship group for women and friends in the Python community.

How to integrate Django applications to authenticate against already existing identity management systems like LDAP, Kerberos, etc. Links:

Sink or swim, five jackets to throw to the new coder - Lynn Root - http://newcoder.io

Advanced e-learning, or introducing programming to new coders.

Tutorials:

  1. Dataviz - <http://newcoder.io/dataviz/
  2. APIs - http://newcoder.io/api/
  3. Web scraping - http://newcoder.io/scrape/
  4. Networks - http://newcoder.io/networks/
  5. GUI (soon)

Intro to Django - Daniel Greenfeld & Audrey Roy

Daniel Greenfeld is a software developer and co-author of Two Scoops of Django. Audrey Roy is a software developer and designer and co-author of Two Scoops of Django.

Hands-on Django workshop. Built a real, working site from the ground up, using Django 1.6 and Python 2.7/3.3. Covered Python and Django setup, project creation, app creation, models, the Django admin UI, views, migrations with South, user image uploads, new user registration, basic forms, and basic internationalization.

Introducing Python as a Main Programming Language in a Company - Patrick Büchler

Patrick Büchler is a Software Developer.

Car analogy - people who go to BMW will get different quality than Fiat. Same with software, but not appreciated.

Right mix of people important. Pointless to have lots of all-stars because they will all have their own idea of how it should be done.

Why Python? Too many languages == uncomfortably hot. Python is platform independent, has big community, good traction/adoption/future plans, good learning curve:

  1. Simple and readable
  2. Versatile and platform agnostic
  3. Can be used for web and on client
  4. Also a philosophy, i.e. the Zen of Python:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea – let’s do more of those!

How to implement Python? How to manage risks?

  1. If you take a decision, implement it quickly.
  2. People learn only with real challenges.
  3. Innovation not the same as research. As entrepreneur you must innovate, not research.
  4. Can’t afford to spend much money on not-financed activities.

Choose project and do it with Python

  1. Project should not be critical.
  2. Not be too small (at least 1 man-year).
  3. Should not contain complex technical challenges.
  4. Should not contain complex business logic.
  5. Should not be in a risky domain.
  6. Should use easy to use framework (such as Django or web2py)
  7. Should be assigned to a specific team, without people who are against the project, with mix of first-movers and conservatives.
  8. Primary goal should still be to finish the project with a profit.

Problems

Mostly went surprisingly smoothly! Consider the following:

  1. Python is not Java!! def my_function() != public int myFunction() Do code reviews! Especially when devs used Java or C# before. Developers coming from VB have less projects.
  2. Allow refactoring: give your team the time to make their first project good.
  3. Enforce refactoring: force your team to make the first project good.
  4. Be patient: do not forget that it is new for most developers.
  5. Be strict: you decided to risk implementing the project in a new language, stick to your decision.
  6. Python is agile, use this: with python debug cycle is very quick, use this i.e. in sprint review.
  7. Don’t interfere too much: let your colleagues work on their own, so they learn!

Factors critical for decision about tech to use:

Tech and org factors (reasonable)

  1. Surrounding systems enforce specific tech.
  2. Base systems used enforce particular tech i.e. Oracle.
  3. IT Departments often proficient on one platform only.
  4. Contracts with vendors or suppliers enforce given tech.
  5. High investments required to change.

Human Factors (personal)

  1. IT Departments often reluctant to change their systems even when outdated or try something new (consider the type of personality who becomes sys admin).
  2. Management hear saying (we MUST have SharePoint because it will solve all our problems as my friend told me on golf course).
  3. Internal Politics (we decided that XYZ is the best architecture, we cannot change now).
  4. Quasi-religious beliefs or important decision makers or influential people (there is no better sport than to provoke a dev by criticizing his language of choice).

The word ‘Python’ won’t open doors, but the folowing may:

  1. Platform independent.
  2. Very fast development cycle - you can even debug and change the code onsite during the sprint review!!
  3. Completely open source - not owned by Oracle unlike Java, MySQL, etc.
  4. Mature.
  5. Big community.

Fears/questions from customers:

  1. Fear of Vendor Lockin: most business people know .NET and Java and believe all else a niche.
  2. Fear of Open Source: understandable, many dead open source projects.
  3. Lend helping hand to sysadmins: maybe he used SQL Server and IIS since 199x! Suddenly it’s PostgreSQL and web2py. Help him and he will be a grateful promoter of your technology.
  4. Most problems not technical! Remind your customer and your team about this.

Was it worth it?

:) Yes!

  1. Python is well established now
  2. At moment 4 different projects with Python
  3. Strategic decision: all individual web projects are done with web2py
  4. Wherever possible suggest using Python

Q: Tried sales pitch “lets do a prototype in Python first and see if it works” A: No, but it is a good idea

General notes: