4 ms·
I'd like to add a subquestion: I'm always told to check out other people's code and study it, but I'm also well aware that popular software doesn't necessarily
by iron_ball 18y ago
I'd like to add a subquestion: I'm always told to check out other people's code and study it, but I'm also well aware that popular software doesn't necessarily mean good code. What source-available projects would you recommend I look at if I want to see some quality examples of the craft?
- culley 18y agoI recommend finding a mentor. Someone who writes code that you respect (be it for quality, clarity or efficiency). Start reading their code and asking questions. The open source community is a good place to start looking if you don't have someone you respect in your own community.
- Agathos 18y agoAnd so the question comes full circle: did you have any particular open source projects in mind? It's a big community.
- huhtenberg 18y agoLinux kernel. Excluding perhaps parts of the network stack - it's a clever and very compact code, but rather hard to follow for uninitiated.
- gizmo 18y agoCan't recommend it. Consider reading something like minix instead. E.g. boot.c https://gforge.cs.vu.nl/plugins/scmsvn/viewcvs.php/trunk/src/boot/boot.c?rev=2691&root=minix&view=markup https://gforge.cs.vu.nl/plugins/scmsvn/viewcvs.php/trunk/src...
- PieSquared 18y agoPython. Not all the code is good, but I remember reading a lot of Python code when I was trying to write an interpreter of my own, and some parts of it just left me starting at the screen in amazement, due to the beauty and simplicity of some of the ideas. Maybe I'm not the best at reading badly commented C code, but Ruby and MzScheme were not nearly as pleasant.
- corentin 18y agoThe source code for the Prex real-time kernel is very well-written: http://prex.sourceforge.net/src/ http://prex.sourceforge.net/src/
- silentbicycle 18y agoQmail, both at a source level and the way the overall system fits together. See also: http://c2.com/cgi/wiki?GreatProgramsToRead http://c2.com/cgi/wiki?GreatProgramsToRead and the linked pages, which discuss your question further.
- rsheridan6 18y agoI thought of qmail and some of djb's other code too. He has an idiosyncratic but apparently effective way of doing things. I also like Scheme48.
- gizmo 18y agoThe OCaml interpreter/compiler is really good. Compare with the Ruby interpreter, which is really bad. SBCL is also interesting; has a lot of good parts.