Writing Robust Code

As you write your code, take time to think about what could go wrong. Under what circumstances will your code break? If your code breaks, how will that affect the user’s experience? With questions like these in mind, you can use tools such as validation and try/catch to write code that can handle whatever crazy stuff gets thrown at it. That is the kind of code that makes good programs, and that is the kind of code you want to write.

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.