Skip to main content

Metaprogramming

  • Chapter
  • First Online:
  • 10k Accesses

Abstract

One of the key mantras in programming is to not repeat yourself. Whenever you do the same task more than once, you should take a look at it to see if there is any way to automate it. This is the primary reason for writing programs. But this applies equally to the task of writing the code itself. If you are repeating chunks of code, you should step back to see if there is some better way of achieving the same result.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   37.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Joey Bernard

About this chapter

Cite this chapter

Bernard, J. (2016). Metaprogramming. In: Python Recipes Handbook. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0241-8_8

Download citation

Publish with us

Policies and ethics