Skip to Content
Learning Processing
book

Learning Processing

by Daniel Shiffman
April 2009
Intermediate to advanced content levelIntermediate to advanced
472 pages
11h 36m
English
Morgan Kaufmann
Content preview from Learning Processing
Chapter 7

Functions

When it’s all mixed up, better break it down.”

Tears for Fears

In this chapter:

– Modularity.

– Declaring and defining a function.

– Calling a function.

– Parameter passing.

– Returning a value.

– Reusability.

7.1 Break it down

The examples provided in Chapters 1 through 6 are short. We probably have not looked at a sketch with more than 100 lines of code. These programs are the equivalent of writing the opening paragraph of this chapter, as opposed to the whole chapter itself.

Processing is great because we can make interesting visual sketches with small amounts of code. But as we move forward to looking at more complex projects, such as network applications or image processing programs, we will start to have hundreds ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Processing, 2nd Edition

Learning Processing, 2nd Edition

Daniel Shiffman
Interactive Lecturing

Interactive Lecturing

Elizabeth F. Barkley, Claire H. Major

Publisher Resources

ISBN: 9780080920061