A simple program without functions

Having an understanding of how our iPhone reads our code as a line by line recipe can help us understand the need for the concept of a function.

Let's imagine, for a moment, that we do not have any concept of functions when writing our code. Then, if we want to make a simple app that simulates the making of a pizza, we can write the following code:

print("Flattening the dough to form a round pizza A simple program without functions")
print("Adding some tomato sauce A simple program without functions")
print("Adding some mozzarella cheese ")
print("Adding some spicy pepperoni ") print("Preparing ...

Get Swift iOS Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.