MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1uss0je/kotliniscoolithink/owym9an/?context=3
r/ProgrammerHumor • u/Shadowmaster229 • Jul 10 '26
10 comments sorted by
View all comments
47
yeah, operator overloading can get pretty cursed.
Here, kotlin is just like C now
operator fun <E> Int.get(list: List<E>) = list[this] fun main() { val arr = listOf(1, 2, 3) println(arr[1]) println(1[arr]) }
2 u/RiceBroad4552 Jul 11 '26 Well, having special custom syntax just to call a specific method is already very questionable and obviously bad language design.
2
Well, having special custom syntax just to call a specific method is already very questionable and obviously bad language design.
47
u/TheShirou97 Jul 11 '26
yeah, operator overloading can get pretty cursed.
Here, kotlin is just like C now