4 ms·
Sticking fn in front of every def isn't quirkier? Some parts of the kernel use this style. It's also advantageous because it enables long return types and lon
by keikobadthebad 4y ago
Sticking fn in front of every def isn't quirkier?
Some parts of the kernel use this style.
It's also advantageous because it enables long return types and long function names neatly at the same time.
- gnulinux 4y ago> Sticking fn in front of every def isn't quirkier? No because almost every single programming language that's not C/C++ has a keyword that signals function declaration.
- lwswl 4y agoA good number of those don't have mandated return types, so that keyword is their way of copying c(++)'s look, so its "func main()", like "void main()", instead of just "main()", which to a some people may look strange.
- deleted 4y ago[deleted]
- gnulinux 4y agoI don't understand why this is relevant. Regardless of the rationale to add it to the language, if syntactically it's `func main()` I can tell it's a function definition because it's always `func`. You can't do that in C++ since it's often some type.