Overview - Why operators are functions in Kotlin
What is it?
In Kotlin, operators like +, -, *, and / are actually special functions. This means when you write a + b, Kotlin is calling a function named plus on a. This design lets you customize how operators work for your own types by defining these functions yourself. So, operators are just a simpler way to call functions.
Why it matters
This approach makes Kotlin very flexible and consistent. Without operators as functions, you would need different rules for operators and functions, making the language harder to learn and use. It also allows you to create clear, readable code that behaves exactly how you want, especially when working with your own data types.
Where it fits
Before this, you should understand basic Kotlin functions and classes. After this, you can learn about operator overloading and how to define your own operator functions to make custom types work naturally with operators.