1 Making programs safer

This chapter covers

  • Identifying programming traps
  • Looking at problems with side effects
  • How referential transparency makes programs safer
  • Using the substitution model to reason about programs
  • Making the most of abstraction

Programming is a dangerous activity. If you’re a hobbyist programmer, you may be surprised to read this. You probably thought you were safe sitting in front of your screen and keyboard. You might think that you don’t risk much more than some back pain from sitting too long, some vision problems from reading tiny characters onscreen, or even some wrist tendonitis if you happen to type too furiously. But if you’re (or want to be) a professional programmer, the reality is much worse than this.

The main ...

Get The Joy of Kotlin 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.