Support unavailable
Please try again later

Meta Programming - Some Use Cases for Everyday Programming

Python offers many meta programming possibilities. Besides metaclasses, function and class decorators, descriptors, or context managers can be used to “program your program”.

This talk gives a short overview over these techniques without going into too many technical details. It rather tries to provide useful examples for what these techniques can be applied to make your programs better.

Meta programming is very powerful. But too much magic may be counterproductive; your programs might become too complex. On the other hand, meta programming can help to make your programs more pythonic, help to avoid boilerplate code, and can provide a great tool to debug your code.

There are several categories of tasks meta programming may be helpful:

  • Design a new program architecture. Especially if you need to create framework-like applications and want to make it as easy as possible for programmers to use your framework. If your framework needs to call user code instead of being called, meta programming may help to make things simpler.

  • Monitor programs in a production environment. Tests and mocks are great but sometime it is very difficult to setup conditions that are enough production-like to reproduce the essential behavior you would like to check for. Some meta programming can be helpful to provide insight what is going on in your programs.

  • Analyze existing programs. You may not be that lucky to start from scratch but rather inherit an existing software that might have been around for a while and went through a few hands before. Insufficient or outdated documentation? What is really going on in the code? Meta programming may provide some effective tools to get know more about the internals of the code.

Bring your ideas to discuss about when and when not use meta programming techniques in Python.

in on Thursday 4 July at 11:15 See schedule

Do you have some questions on this talk? Leave a comment to the speaker!

New comment


Language
EN
Duration
60 minutes (inc Q&A)

Tagged as

debugging metaprogramming testing principles refactoring application-design architecture validation software-engineering
Our Sponsors
Spotify
Python Experts
SSL Matrix
Wanna sponsor?