GIGO: Garbage In, Garbage Out

Input and output are closely related; a program’s output depends on the input received. Thus, if a program receives garbage data as input, it will produce garbage as an output. In kittenbook, we ask users for their name and then (foolishly?) assume that they are actually going to enter their real name. If it’s not their real name, we assume that they will at least provide a real name, or something that looks remotely like a name. But the text box we provide is free form, and our users can enter whatever characters they want. They could enter their address, their favorite movie quote, a math equation, or even some malicious code. If anything but a name is entered, the output won’t make any sense: Hello, Do, or do ...

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.