Overview - Why Kotlin has no primitive types at source level
What is it?
Kotlin is a programming language that does not show primitive types like int or float directly in its source code. Instead, it uses regular classes like Int or Float to represent numbers and other basic data. This means when you write Kotlin code, you always use these class names, not special primitive keywords. Under the hood, Kotlin still uses efficient primitive types when possible, but hides this detail from the programmer.
Why it matters
This design makes Kotlin code simpler and safer to write because you don't have to worry about different types for numbers and objects. Without this, programmers would need to remember when to use primitive types and when to use objects, which can cause confusion and bugs. By hiding primitives, Kotlin lets you focus on your logic, while still running fast and using memory efficiently.
Where it fits
Before learning this, you should understand basic data types in programming and how some languages separate primitive types from objects. After this, you can explore Kotlin's type system more deeply, including nullable types and generics, which benefit from this unified approach.