Elektrine lite

← Feed

@tagir_valeev@mastodon.online

2026-01-21 10:48 UTC

@taschenorakel it's Kotlin, but your question is very valid. Declaring a custom data class is a one-liner, but people still use the Pair class from the standard library, because it's already there. Generic Pair class is a mistake. It promotes lazy programming. Luckily Java doesn't have it.

Replies (2)

  • @tagir_valeev Oh! This is even Kotlin? Why on earth would some write such terrible code, that's bad already in traditional languages, in a modern language like Kotlin?

    Open ##1205419

  • @the_moep@mastodon.de 2026-01-21 11:33

    @tagir_valeev While Java might not have a pair natively I've seen tons of people use AbstractMap.SimpleEntry for that functionality which imo is worse. @taschenorakel

    Open ##1205425