Ask HN: Which function definition keyword do you prefer, def or fn?
1•winwang•3h ago
I'm curious about what people think of `def` vs `fn`, two short keywords for starting function definitions.
...Or maybe we should subscribe to the church of `df`, haha.
Comments
sitkack•3h ago
def could be for lots of things, fn is for functions. I don't think it matters much as long as you have one. C would have been so much easier to parse. Just copy Zig or Rust.
butlersean•46m ago
def means define, could be used to define all kinds of things
sitkack•3h ago
butlersean•46m ago
fn isnt a legitimate short form of function
fun doesnt work because of the amusement factor
func is the only alternative we have left