9 ms·
Off topic but I wish Go had chosen to use fn rather than func
by mikemitchelldev 2y ago
Off topic but I wish Go had chosen to use fn rather than func
- whobre 2y agoI’ll never understand why people care about such things.
- ziggy_star 2y agoOh hey, are you that Mitch? I literally just signed up to ask if anybody can recommend any good Zig codebases to read other than Tigerbeatle. How's your terminal going? Edit: The rest of the posted site seems like a treasure trove not just this one article. Was wondering how to get into Zig and here we are. Such kismet. Almost missed it so heads up for others.
- mikemitchelldev 2y agoNo, sorry not me. Though I have signed up for an invite for that terminal by Mitchell Hashimoto (I think his name is).
- slimsag 2y agoWe're working on a game engine in Zig[0] If you're looking for interesting Zig codebases to read, you might be interested in our low-level audio input/output library[1] or our module system[2] codebase - the latter includes an entity component system and uses Zig's comptime to a great degree to enable some interesting flexibility (dependency injection, global view of the world, etc.) while maintaining a great amount of type safety in an otherwise dynamic system. [0] https://machengine.org/ https://machengine.org/ [1] https://github.com/hexops/mach/tree/main/src/sysaudio https://github.com/hexops/mach/tree/main/src/sysaudio [2] https://github.com/hexops/mach/tree/main/src/module https://github.com/hexops/mach/tree/main/src/module
- ziggy_star 2y agoThanks!
- deleted 2y ago[deleted]
- samatman 2y agoI happen to agree. When I see 'fn' I "hear" function, when I see 'func' I hear "funk, but misspelled". Also, with four space indentation (or for Go, a four space tabset), 'func' aligns right where the code begins, pushing the function name off one space to the right. For 'fn' the function name starts one space before the code, I find this more aesthetic. Then again, the standard tabset is eight spaces, so this matters less in Go. It would be pretty silly to pick a language on the basis of that kind of superficial window dressing, of course. But I know which one I prefer.
- scns 2y agoI like the way Kotlin did it: fun. Gives a nice alignement of four with the space. And functional programming can be fun.
- vram22 2y ago>And functional programming can be fun. can is the operative word, not is. Thinking of that other word, the m-word, that sounds like nomad. ;) /jk