ITT we post examples of well-written open source codebases to learn or draw inspiration from. Please restrict your suggestions to codebases that you have actually spent some time reading.
I'm fond of reading bits of the earlier, C-based idTech engines, and they're often held up by others in the blogosphere as an example of good C, so they'll be what I'm recommending.
This guy has written some pretty detailed code reviews of the engines that serve as excellent high-level introductions before you start peeking in the source, if you'd like to study the techniques used by the engines themselves and not just the structure of their code.
I'm interested in seeing some recommendations for dynamic languages like Lua. My idea of how to properly structure a program is limited to idiomatic C at the moment, which makes writing Lua programs feel somewhat awkward to me.
>>10
Lennart Poettering is going to be the reason I finally switch to FreeBSD, I can feel it now. Everything he's ever written has been harmful shit, and it's gaining prominence.
- Huge Meteor Rocks Russia
- Pistorius Shot Girlfriend Through Bathroom...
- Bin Laden Shooter Only Has Himself to...
- Adam Lanza Had Sensory Disorder
- Same-Sex Couple Set for National Cemetery...
Almost all of these are C codebases. Let's C some DYNAMIC_LANGUAGES!
Name:
Anonymous2013-02-15 17:52
Autoconf
Name:
Anonymous2013-02-15 20:50
>>8
The Linux kernel mainline is probably the highest quality open C codebase of its size, anywhere. Unlike the id engines, it wasn't written by people working on a tight deadline and cleaned up later, so it has fewer warts. Its feature set is also large, which gives more insight into solving complex problems than a deliberately limited system like Plan 9. Finally, the kernel sources use many different styles of C programming (looking past superficial things like indentation) so reading them will expose you to more diverse ways of thinking.
Name:
Anonymous2013-02-15 21:28
>>25 Finally, the kernel sources use many different styles of C programming (looking past superficial things like indentation) so reading them will expose you to more diverse ways of thinking.
Could you give some good starting points?
Name:
Anonymous2013-02-15 21:57
>>26
Not >>25-san, but you could try reading the O'Reilly Understanding the Linux Kernel then diving right in, reading whichever part you want (scheduler, device drivers, process management, etc.). That's what I did.
Why not learn some ultra-theoretical pure mathematics and then invent a new form of computing where you then invent a new kind of computer and which then you invent a new kind of programming concept and which then you invent a new kind of language.
>>26,27
The best way is to just look at parts of the kernel that perform distinctly different functions. There is a lot of complex stuff in the kernel, too much for any one person to understand, so you will find a lot of domain specific variations in style. For instance, arch boot code is usually so utterly procedural that even the C portions read like macro assembly. By contrast, the most complex driver stacks are heavily OO, with plenty of layering to separate logical and physical buses and subdevices.
Name:
Anonymous2013-02-16 19:37
>>9,16
Most game engines are horrible messes of software. In comparison, the id Tech engines are very well designed and consistent. Since most engines are obviously going to be closed source forever, the id Tech engines are possibly the best we have to study.
Perfect example, the guy who did the id Tech code reviews just did one for the Build Engine (Duke Nukem 3D). It did amazing things for its time, but god damn what a hideously designed program it is.
why wont they attach such renderer to GTA and sell it as pay-for-hour cloud service? I'm sure 8x boards aint that expensive for server side.
Name:
Anonymous2013-02-16 22:03
>>36
I'm making games to run on Android and iOS and really don't care about industry state-of-the-art buzzword compliance, just that it runs smoothly and looks sharp. I think chasing photorealism is silly, because both a technically inferior game with stylish and imaginative artwork or even a graphically minimal one with compelling gameplay is going to get more attention (from non-geeks, at least.)
I recently played one of those ultrarealistic war games on an XBox for the first time, don't know which one, they all look the same to me- and realized, for all the gee-whiz eye candy, this is still pretty much just CounterStrike. So you can see ripples in all the puddles on the ground. Awesome. Wait, I can go outside and do that. Or, I can play CounterStrike from 12 years ago and get the same gameplay experience.
Name:
Anonymous2013-02-17 14:05
The official Lua implementation is a really high quality ANSI C codebase. The average /prog/rider should be more than capable of digging into it:
LuaJIT is also a fascinating implementation (and probably the program to study if you want to write a fast interpreter/JIT), but all of the platform-specific assembly and whatnot makes it a lot more difficult to comprehend.