Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's wrong with fn? It's perfectly understandable. I don't understand what the bikeshedding about keywords like this is about.


I don't even code in kotlin but I know that kotlin has function as fun :P

Such small things as using __ __ in python and small inconveniences (lua's 1 instead of 0) really has a lot of people, what do I say.. yea, polarized on this matter.


0 vs 1 indexing has an actual semantic difference that you have to keep in your head at ~all times, but could have a text editor plugin that rewrites func<->fn since it's purely syntactical.

What is inconvenient about it?


fun is the best, as it makes the function name align with the code block indented 4 characters :D

    fun main() {
        println("Hello, world!")
    }
        ^ aligned here! \o/


Keywords usually are quite pronounceable, and some of them are even proper words. How do you read fn?


Usually as "function"


fun


fn




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: