Skip to content
myAudience.
← Explore the library

The smallest useful program

By Code from zero · myAudience

AI-generated editorial illustration for Code from zero; not a documentary photograph

myAudience · AI-generated illustration · Original generated illustration; not documentary evidence

Write a cost function in words: receive a number of hours, multiply it by two, add three, return the result. Test zero hours and three hours before adding a screen or button. A clear function separates a rule from its presentation. This is an original practice challenge: also decide how your program should reject a negative number or a value that is not numeric.

Author source references