Introduction
A good piece of code, says the software design principle of least astonishment, is one that does pretty much what you were expecting it to do.
Well, by that definition, the programs I’ve prepared for you in this book are absolutely terrible. Just awful. They’ll baffle, delight, entertain, and surprise you at every turn.
I’m not talking about spaghetti code, gnarly naming, or complicated class structures. Each puzzle is just a few lines of simple Kotlin—and that’s why I suspect you’ll find their offbeat outcomes just as intriguing and compelling as I do.
Most of the time, Kotlin is clear, concise, expressive, and safe. That’s the reason I love it! But over the years, the programs that do something unclear, unsafe, or unexpected are ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access