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.
I kind of appreciate fn, personally. It's nice having function declaration lines with two less unnecessary characters in their length.
I use emacs' prettify-symbol mode to turn every language's function keyword into ʩ. Don't think I incurred in God's wrath just yet.
How about "proc"? Too different? I don't like fn either but function is too much. Fun and func aren't great either. I'd go with proc or fn.
"func" is fine; "function" is too long. "fn" is also good, but for example, Go was designed with "func," and it's one of the most successful, readable languages in the world, so why not?
C++ does not have a function keyword at all, I wonder why did they add it in the first place.
F# uses “fun” and I like it. The vowel does help a bit and I never confuse it with the English word. The worst one IMHO is Haskell’s “\”.
Since interop is such a big design goal I wonder if fn was chosen after analyzing the impact of alternative keywords present in large c++ code based that would impact interop in a negative way (eg requiring more escaping).
I like it the most when there's no keyword. Just name() and return type.
Pony's keywords are the best. "fun" and "be" are just, well, fun lol.
I agree, I hate fn. Also not a fan of func though.
In C++ you can use indifferently either the class or typename keyword to introduce template arguments (because of course you can). A lot of styleguides suggest using typename because class is slightly misleading (the type could be anything not just a class).
In practice everybody just uses class, because who as the time to type the full keyword and signature declarations in C++ are already unwieldy as it is.
Tbh, I wonder why modern languages still have a function keyword at all, e.g.:
const add = (a: i32, b: i32): i32 => a + b;
...or any variation of the arrow-function idea...
What's wrong with fn? It's perfectly understandable. I don't understand what the bikeshedding about keywords like this is about.