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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights 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
DOI: https://doi.org/10.1007/978-1-4842-0241-8_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0242-5
Online ISBN: 978-1-4842-0241-8
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)