4 ms·
It seems like that's how this question is always answered. I'd also be interested to see some good application code. Also curious about some good, not too huge
by westoncb 7y ago
It seems like that's how this question is always answered. I'd also be interested to see some good application code.
Also curious about some good, not too hugely sized, game code (preferably something not written in C/C++, maybe like an indie game from the past decade or so). Anyone know something?
- tschwimmer 7y agoI almost feel like game code is a counter example. Unless you're making a massively multiplayer game, the code is throwaway because once you ship development effectively stops (or is limited for bugfixes and dlc). Would be interesting to see what the LoL or Warcraft codebase looks like though.
- mehrdadn 7y agoFor C, how about ReactOS?
- dudus 7y agoRedis would probably be better.
- mehrdadn 7y agoAny chance you could elaborate? How/why?
- chimpburger 7y agoRedis is widely used in production environments. The code quality matters.
- mehrdadn 7y ago> Redis is widely used in production environments. The code quality matters. That's how you judge source code quality? By measuring its popularity? And ignoring the actual code?
- chimpburger 7y agoThat's not what I said.
- orneryostrich 7y agoKeldon Jones’ Race for the Galaxy AI is brilliant. Every line is documented C. It trains and deploys a neural net. It has a fast and functional GUI. Most diehard RftG players have cut their teeth by losing to Keldon a few dozen times before really learning the game. Keldon was contracted a few years later to develop the RftG apps on iOS and Android, which are easily worth $4. Source: https://github.com/bnordli/rftg https://github.com/bnordli/rftg Precompiled binaries: http://keldon.net/rftg/ http://keldon.net/rftg/
- taspeotis 7y ago> Every line is documented C Every line? Oh dear [1]: /* Set verbose flag */ verbose++; ... /* Set advanced flag */ advanced = 1; ... /* Set expansion level */ expansion = atoi(argv[++i]); ... /* Initialize game */ init_game(&my_game); I assume the verbose flag is incremented because there's multiple levels of verbosity, whereas the advanced flag is a boolean, and i is incremented because expansion is not a command line flag (rather, an option). But I wouldn't know that from the comments! Especially useful to know if like, verbosity actually has multiple levels, like -v and -v -v or -v -v -v and so on ... instead of knowing that init_game is ... init'ing the game. Compare all those comments to this [2], which is actually a spectacularly useful comment. Signal to noise ratio! [1] https://github.com/bnordli/rftg/blob/master/src/learner.c https://github.com/bnordli/rftg/blob/master/src/learner.c [2] https://github.com/bnordli/rftg/blob/master/src/replay.c#L94 https://github.com/bnordli/rftg/blob/master/src/replay.c#L94
- kstrauser 7y agoYikes, I've gotta agree: /* Exit */ exit(1); Well, yes, I see that. It might have been helpful to extend that to "Exit with an error status", perhaps, but as-is it tells you literally nothing that the code doesn't.
- teknopaul 7y agoIMHO Coding guides should ban "SBO comments" Statin the Bleedin Obvious. Let devs decide what SBO is, usually its bleedin obvious.