Being able to access items in collections using subscripting (i.e. with square brackets, like myCollection[2]) is a really big convenience for me. I hate typing method names for this functionality, especially the boring old get() method. Not only is get() boring, it’s incredibly nondescript. (On a tangent: In my opinion, it would be nice if the “default” name for a method like this was sub() or subscript(), but too few people even know the term “subscript”).
Both Python and Kotlin allow you to use operator overloading in order to get this functionality, and in this article, I’m going to do a medium dive into each one, comparing and contrasting their limitations and how they work.
Continue Reading


