Book Image

Practical Maya Programming with Python

By : Robert Galanakis
Book Image

Practical Maya Programming with Python

By: Robert Galanakis

Overview of this book

Table of Contents (17 chapters)
Practical Maya Programming with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Defining composability


The idea of composability is to write code as small and well-defined units that can be combined with other units in flexible and predictable ways. Composable code is decoupled and cohesive. That is, the code has few dependencies and is responsible for a single responsibility. Writing composable code is the key to creating maintainable systems and libraries you'll use for years.

Tip

A unit is a function, class, or method. It is generally the smallest piece of independently useful code, and should be smaller than a module or group of classes (system). There is no black and white definition, so prefer smaller and simpler to larger and more complex.

Maya's utility nodes, such as the MultiplyDivide node, are examples of composable units. They are very clear in their inputs, outputs, and descriptions of what they do. The input to a MultiplyDivide node can be a number from any source, such as a Maya transform, another utility node, or a constant. The MultiplyDivide node does...