Tip 2 | Insist on Correctness |
[ââWhite Belt] These considerations are essential to your coding from day one. |
In toy programs itâs easy to tell the difference between correct and incorrect. Does factorial(n) return the correct number? Thatâs easy to check: one number goes in, and another number comes out. But in big programs, there are potentially many inputsânot just function parameters, but also state within the systemâand many outputs or other side effects. Thatâs not so easy to check.
Isolation and Side Effects
Textbooks love to use math problems for programming examples, partly because computers are good at math, but mostly because ...
Get New Programmer's Survival Manual 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.