Being new to Kotlin and having read several code examples to better understand this language that I rather like, I repeatedly find it strange to see a function definition starting with the keyword “fun”. I know writing code in Kotlin is productive and fun, but seeing the word “fun” appear so often in Kotlin code is distracting and reduces code readability.
“Programs must be written for people to read, and only incidentally for machines to execute.” ― Harold Abelson, Structure and Interpretation of Computer Programs.
Using keyword “fun” to define a function does not make it easier to read the code; it arguably makes it harder as “fun” is a misleading / distracting keyword to most English speakers (IMHO) in the context of program source code. “function” would make it very clear what is being defined, just like the keyword “class” is used in Kotlin to define a class. The proposed keyword “function” could be shortened to “func”, but why shorten it further to “fun”?
“fun” is rather low on the list of appropriate abbreviations for the word “function”. See http://www.abbreviations.com/abbreviation/function
Using “function”’ as a keyword instead of “fun”, fits in rather naturally with other keywords in Kotlin such as “package”, “class”, and “object”.
It just seems like an unfortunate oversight, given the use of words like “object” and “class”, that “function” was overlooked as a keyword in Kotlin.
Has the ship sailed on this request, or could it be accommodated in a future release?