Delightful Programming with Kotlin: Part #1
A compiler tells you whether the code you wrote is syntactically valid. A good compiler, however, doesn’t do just that; it also tells you at build time whether your code might run into a logical bug later on at runtime. One such logical bug we often make as developers is not handling the possibility that map lookups yield nothing. Being a good compiler, kotlinc knows that the entry you’re looking up in a map might not exist, and therefore errors out if it detects that you weren’t prepared for that possibility....