←back to thread

155 points samuell | 3 comments | | HN request time: 0s | source
Show context
mihaic ◴[] No.44747304[source]
It's become a pet peeve of mine, but for the love of God, if anyone with input in Carbon is scanning this, what can be done to use "func" instead of "fn" as a keyword?

That all-consonant keyword always makes it seem like I'm reading Hungarian notation when reading Rust for instance. An other options I've seen for instance in Pony, "fun", is already an English word with a completely different meaning.

Even the "function" from Javascript seems fine to me.

replies(12): >>44747518 #>>44747538 #>>44747604 #>>44747791 #>>44747854 #>>44747943 #>>44747960 #>>44747974 #>>44748106 #>>44748147 #>>44748268 #>>44748672 #
treyd ◴[] No.44748268[source]
What's wrong with fn? It's perfectly understandable. I don't understand what the bikeshedding about keywords like this is about.
replies(2): >>44748913 #>>44750758 #
1. Imustaskforhelp ◴[] No.44748913[source]
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.

replies(2): >>44755633 #>>44783480 #
2. treyd ◴[] No.44755633[source]
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?

3. samuell ◴[] No.44783480[source]
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/