The Value of Small Changes

Now we’re going to enhance our program so that we can say hello to anyone, instead of just “Hello, World!” As you make the enhancements, make small changes. Then test those small changes before you make more changes. At first, this process might seem tedious and unnecessary. However, if you make many changes before testing and find that your program isn’t working, you will have a hard time determining which of your changes broke the program. If you make one small change before testing and see that your program is broken, you will know exactly what you did to break it.

Our first small change is to ask for a name. A personalized greeting isn’t much good without a name. For this example, we use a function called prompt ...

Get Learning to Program 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.