https://kotlinlang.org logo
Title
h

Hullaballoonatic

03/03/2019, 8:43 PM
Due to its extensions and overall syntax philosophy, kotlin is the only language where i feel i can consistently write functions in the form of
subject.verb(object)
. I personally hate syntax like python's
len(list)
, because I feel like as a property of the list, it should be called as
list.len
, and that
len(list)
implies some kind of transformation of
list
s

serebit

03/03/2019, 9:26 PM
Completely agree. It feels weird to write an action performed by an object (as in
.len
) as an action performed on an object (such as
len()
)
h

Hullaballoonatic

03/03/2019, 9:27 PM
also i want all functions to be verbs, or perhaps to imply expensive functions
so i prefer that in kotlin you don't need the
()
, you can just do
object.property
and it will still run the getter
y

yen

03/03/2019, 10:58 PM
One small advantage of
len()
is that it’s a function, and therefore can be composed with other functions nicely.
h

Hullaballoonatic

03/03/2019, 10:59 PM
but in Kotlin properties can be composed with other functions as well, because of `get`ters
i think that's the superior approach
i feel like python is designed for me to hate it, but i'm getting used to it.
i'm headed into AI R&D and so i pretty much have to force myself to become very good at python