Presented at https://www.meetkt.org on 21 October 2021
The first episode of this series touched upon leveraging the Kotlin type system, adopting ideas from the functional programming world, leveraging the robustness principle, and failing fast to build robust software.
In this session, we'll focus on the thing that makes software move the word — side-effects. Side-effects are what make tangible changes to the real world with which the software is interacting. These changes could be,
Making network calls
Saving your wishlist on your favorite shopping website
Rendering graphics on the screen so that your favorite video game character can jump over nefarious enemies, collect gold coins, and save the prince or princess from the supervillain.
And naturally, when your program has side-effects that interact with the real world, things can go wrong in so many ways because the world is not a perfect place to live in. What happens when your database is not available, or your disk is full? Your program will throw exceptions because it failed to accomplish the mission you initially set it to.
Exceptions can be painful to deal with. So, we will look into what they are, the implications of using them to decide the control flow of your program, and what patterns you can use to deal with them elegantly.
Finally, we'll finish by looking into how you can design systems and model boundaries between components/classes/functions, therefore, building systems with good testability. This topic will also set the tone for our next session on writing tests!