TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What source code is worth studying?

403 点作者 SatyajitSarangi大约 11 年前
This is one my favourite questions, asked by idlewords: https://news.ycombinator.com/item?id=879101 But its been a long time since then, and with a new set of programming languages, I believe there are new code bases that's worth studying about and learning from. So, which code-base should I be reading about to improve myself?

73 条评论

stiff大约 11 年前
I think you get more benefit from reading code if you study something very close to what you are working on yourself, something in the same domain, in the same framework perhaps, or at least in the same programming language, at best something you are deeply involved in currently.<p>I never seem to get enough motivation to read deeply into random &quot;grand&quot; code bases like Lua or SQLLite, but some months ago I got into the habit of always studying a bunch of projects that use a given technology before I use this technology, and it greatly decreased the amount of time it takes me to get to a &quot;idiomatic&quot; coding style. So instead of diving in a random, I would recommend making researching existing code-bases related to what you are currently doing an integral part of your workflow.
评论 #7603195 未加载
robin2大约 11 年前
Slightly off topic, but Peter Seibel&#x27;s take on the idea of code reading groups, and the idea of code as literature, is interesting: <a href="http://www.gigamonkeys.com/code-reading/" rel="nofollow">http:&#x2F;&#x2F;www.gigamonkeys.com&#x2F;code-reading&#x2F;</a><p>&quot;Code is not literature and we are not readers. Rather, interesting pieces of code are specimens and we are naturalists. So instead of trying to pick out a piece of code and reading it and then discussing it like a bunch of Comp Lit. grad students, I think a better model is for one of us to play the role of a 19th century naturalist returning from a trip to some exotic island to present to the local scientific society a discussion of the crazy beetles they found.&quot;<p>The reason this is off topic is that it sounds like you were after interesting specimens anyway. I don&#x27;t have any code examples as such, although if algorithms count I&#x27;m particularly fond of Tarjan&#x27;s algorithm for finding strongly connected components in a directed graph, and the Burrows-Wheeler transform (as used in bzip).
willvarfar大约 11 年前
Fabien Sanglard <a href="http://fabiensanglard.net" rel="nofollow">http:&#x2F;&#x2F;fabiensanglard.net</a> has some excellent code reviews on his website, particularly games.<p>You could read some of the code-bases he reviews, and <i>then</i> read his review. You&#x27;ll be able to compare and contrast your opinions with his, and if there&#x27;s interesting variation you can blog about it ;)
评论 #7602391 未加载
fotcorn大约 11 年前
The Architecture of Open Source Applications book[0] gives a high level overview on many open source projects. It&#x27;s a good starting point to dive into the code of these projects.<p>[0] <a href="http://aosabook.org/en/index.html" rel="nofollow">http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html</a>
评论 #7605139 未加载
评论 #7604979 未加载
pcx大约 11 年前
I&#x27;ve heard lots of people sing praises for Redis source - <a href="https://github.com/antirez/redis" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;antirez&#x2F;redis</a>. A cursory look into the source shows a very well documented code-base. It&#x27;s one of the top items in my to-read-some-day list. Salvatore is an excellent C programmer and takes a lot of pain in writing good documentation, despite his not so great English skills. A shout out for him, thanks for setting an example.
oneeyedpigeon大约 11 年前
To mix things up a bit, I&#x27;m going to give two very small examples of code that can be understood quickly, but studied diligently. Both are in JavaScript, which I notice you mention specifically in another comment:<p>[1] Douglas Crockford&#x27;s JSON parser. Worth a look because it is excellently commented and is easily understandable <a href="https://github.com/douglascrockford/JSON-js/blob/master/json2.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;douglascrockford&#x2F;JSON-js&#x2F;blob&#x2F;master&#x2F;json...</a><p>[2] Bouncing Beholder. A game written in 1K of highly obfuscated code, which the author expands upon here. Worth it because it teaches some crazy optimisation techniques that are applicable to all programming, but also includes plenty of javascript-specific trickery. <a href="http://marijnhaverbeke.nl/js1k/" rel="nofollow">http:&#x2F;&#x2F;marijnhaverbeke.nl&#x2F;js1k&#x2F;</a>
评论 #7602880 未加载
dailo10大约 11 年前
Python Sudoku Solver by Peter Norvig -- an elegant solution in one page of code. When I read this, I felt like code is art.<p><a href="http://norvig.com/sudoku.html" rel="nofollow">http:&#x2F;&#x2F;norvig.com&#x2F;sudoku.html</a>
评论 #7603180 未加载
jacquesm大约 11 年前
<p><pre><code> C -&gt; Varnish PHP -&gt; Yii Ruby -&gt; Merb Scheme -&gt; Arc Clojure -&gt; Core JavaScript -&gt; Multeor </code></pre> Any languages in particular that you&#x27;re interested in not covered above?
评论 #7602378 未加载
评论 #7602418 未加载
评论 #7602668 未加载
评论 #7602409 未加载
评论 #7604208 未加载
biscarch大约 11 年前
Erlang: Riak <a href="https://github.com/basho/riak" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;basho&#x2F;riak</a> Riak is actually a layering of a few different projects including Riak KV, Yokozuna (Solr), Riak Core, etc. It was grown out of the Dynamo paper.<p>Haskell: Snap <a href="https://github.com/snapframework/snap" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;snapframework&#x2F;snap</a> Snap is another project built in layers (snap-server, io-streams, snaplets, snap-core). The 1.0 release makes some pretty massive structural changes behind the scenes changes with minimal breakage of the public api and io-streams is a very nice api to work with.<p>JavaScript: Underscore.js <a href="http://underscorejs.org/docs/underscore.html" rel="nofollow">http:&#x2F;&#x2F;underscorejs.org&#x2F;docs&#x2F;underscore.html</a> Underscore is a utility library that gives a nice overview of various techniques in JS, such as how to handle equality, use of apply, ternary operators, etc. Many functions have fallbacks to ECMAScript 5 native functions.
评论 #7605557 未加载
davidw大约 11 年前
I&#x27;m partial to the Tcl C code:<p><a href="https://github.com/tcltk/tcl/blob/master/generic/tclFCmd.c" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tcltk&#x2F;tcl&#x2F;blob&#x2F;master&#x2F;generic&#x2F;tclFCmd.c</a><p>It&#x27;s very nicely commented and has a nice, easy to read style throughout (<i>except</i> for the regexp files).
raverbashing大约 11 年前
The Linux Kernel<p>Very clean (mostly) and very revised C code, following a strict code convention<p>(Of course it&#x27;s kernel code, so some things don&#x27;t apply to userspace, still)
fit2rule大约 11 年前
The sources to Lua are pretty darn great:<p><a href="http://www.lua.org/source/5.2/" rel="nofollow">http:&#x2F;&#x2F;www.lua.org&#x2F;source&#x2F;5.2&#x2F;</a>
评论 #7603500 未加载
评论 #7602717 未加载
spacemanmatt大约 11 年前
Please enjoy the source code of PostgreSQL (any version, but latest is generally recommended) core. It is very well factored, and typically also very well commented. This community cares a <i>great</i> deal about code quality, because they are so clear on the relation between readability, diagnosability, and execution correctness.
评论 #7604949 未加载
DalekBaldwin大约 11 年前
Honestly, aside from learning to express a few extremely specific patterns in your language of choice concisely and elegantly and reminding yourself of the existence of certain libraries and utility functions so you don&#x27;t accidentally waste time reinventing them, I think reading source code is a pretty useless exercise unless you also have a detailed record of how that source code came to exist in its present form. Until there is some revolutionary new tool for generating a human-understandable narrated history of large-scale design decisions from a source control history, your time will almost certainly be better spent reading textbooks that incrementally develop a piece of software over several chapters. Even that is cheating -- the authors know exactly where they want to end up and they won&#x27;t include all the missteps they made when they first started writing similar programs. But it&#x27;s still loads better than the alternative. Just as sitting in a law school library absorbing an encyclopedic knowledge of the law won&#x27;t really train you to make arguments that will fly in front of a judge, reading a code base as a dead, unchanging document won&#x27;t teach you what it is to live in that code.
评论 #7604069 未加载
SixSigma大约 11 年前
The plan9 operating system<p>* The lack of ifdef&#x27;s that make cross compiling a breeze<p>* It is easy to understand, compare to reading the Linux kernel<p><a href="http://plan9.bell-labs.com/sources/plan9/sys/src/" rel="nofollow">http:&#x2F;&#x2F;plan9.bell-labs.com&#x2F;sources&#x2F;plan9&#x2F;sys&#x2F;src&#x2F;</a>
rch大约 11 年前
Take a look at Redis sometime. You might want to actually work on it a bit to help internalize what you&#x27;re reading. Here are a couple of articles that might help get you started:<p><a href="http://pauladamsmith.com/articles/redis-under-the-hood.html" rel="nofollow">http:&#x2F;&#x2F;pauladamsmith.com&#x2F;articles&#x2F;redis-under-the-hood.html</a><p><a href="http://www.starkiller.net/2013/05/03/hacking-redis-adding-interval-sets/" rel="nofollow">http:&#x2F;&#x2F;www.starkiller.net&#x2F;2013&#x2F;05&#x2F;03&#x2F;hacking-redis-adding-in...</a>
olalonde大约 11 年前
Javascript&#x2F;Node.js: pretty much anything written by <a href="https://github.com/visionmedia" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;visionmedia</a> (his less popular libraries are not very well commented though) <a href="https://github.com/jashkenas/underscore" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jashkenas&#x2F;underscore</a><p>Scheme (and functional programming in general): examples&#x2F;exercises from the SICP book
pavlov大约 11 年前
I learned a lot from the Cocotron source:<p><a href="https://code.google.com/p/cocotron/source/browse" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;cocotron&#x2F;source&#x2F;browse</a><p>It&#x27;s a free cross-platform implementation of Apple&#x27;s Cocoa, so there&#x27;s a lot of stuff there. But the project is well organized, and almost everything is written in a minimalist oldschool Objective-C style.<p>I&#x27;ve looked at some other cross-platform frameworks, and they are often hard to understand because they have been developed by a large group of developers and include lots of complex optimizations and platform-specific code paths. Cocotron is not as finely tuned as Apple&#x27;s CoreFoundation (for example), but much more readable.
agumonkey大约 11 年前
I really enjoyed skimming through Ian Piumarta&#x27;s Maru, a Lisp in C, very pretty code, very concise. (I already mentioned it in other topics)<p><a href="http://piumarta.com/software/maru/" rel="nofollow">http:&#x2F;&#x2F;piumarta.com&#x2F;software&#x2F;maru&#x2F;</a>
villek大约 11 年前
I found the annotated source code of the underscore.js to be very educational: <a href="http://underscorejs.org/docs/underscore.html" rel="nofollow">http:&#x2F;&#x2F;underscorejs.org&#x2F;docs&#x2F;underscore.html</a>
评论 #7604365 未加载
评论 #7602857 未加载
hiisi大约 11 年前
C -&gt; Redis<p>I haven&#x27;t written any C for years, but really enjoyed skimming through Redis codebase, it&#x27;s so clean, easily understandable and extensible.
oscargrouch大约 11 年前
My personal list (mostly imperative languages)<p><i>C++</i>: (Complex software with elegance + performance )<p><pre><code> Dart source code V8 source code (Same people as Dart) LevelDB Chrome (the only downside: too much virtual dispatch -&gt; &quot;javism&quot;) </code></pre> <i>C:</i><p><pre><code> SQLite Redis Nginx Solaris and Freebsd </code></pre> <i>Java:</i><p><pre><code> Rich Hickey implementation of the clojure runtime in Java (it was there in 2009.. maybe now this is in clojure itself??) </code></pre> <i>Go:</i><p><pre><code> The Go standard libraries</code></pre>
lamby大约 11 年前
&quot;Beautiful Code&quot; is worth a read-through, particularly for the commentary.<p>(One thing that I still remember years on is the &quot;drop of sewage&quot; example.)
kjs3大约 11 年前
I learned a huge amount about how real operating systems are put together and the compromises that get made by reading the V6 Unix source via John Lions Commentaries (yes...I had a photocopied copy). Made exploring the BSD 4.2 and 4.3 source trees (another worthwhile exercise) much easier. I suppose if I was starting out today and not in 1985 I&#x27;d look at xv6 or Minix.
AhtiK大约 11 年前
Python =&gt; SQLAlchemy<p>Very clean, feature-rich yet pragmatic and well documented. <a href="https://github.com/zzzeek/sqlalchemy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zzzeek&#x2F;sqlalchemy</a>
评论 #7603300 未加载
评论 #7605169 未加载
projectileboy大约 11 年前
I&#x27;d echo the advice to read the Arc source, and I&#x27;d add the various versions of Quake (C, C++). I learned a lot reading John Carmack&#x27;s code.
评论 #7605988 未加载
pincubator大约 11 年前
Also can someone suggest what is the best way to approach code reading? When I open a library in Python, I am not sure where to start reading, just a bunch of files. Should I randomly pick one file and start reading from there? Is there any common strategy?
评论 #7605734 未加载
entelect大约 11 年前
Minix OS source code <a href="http://git.minix3.org/?p=minix.git" rel="nofollow">http:&#x2F;&#x2F;git.minix3.org&#x2F;?p=minix.git</a>
patrickg大约 11 年前
I suggest the source code of TeX. Not new, but still very interesting to read.<p>source that needs some postprocessing (tangle&#x2F;weave):<p><a href="http://mirrors.ctan.org/systems/knuth/dist/tex/tex.web" rel="nofollow">http:&#x2F;&#x2F;mirrors.ctan.org&#x2F;systems&#x2F;knuth&#x2F;dist&#x2F;tex&#x2F;tex.web</a><p>PDF from the source (including hyperlinks)<p><a href="https://www.tug.org/texlive/devsrc/Master/texmf-dist/doc/generic/knuth/tex/tex.pdf" rel="nofollow">https:&#x2F;&#x2F;www.tug.org&#x2F;texlive&#x2F;devsrc&#x2F;Master&#x2F;texmf-dist&#x2F;doc&#x2F;gen...</a>
betterunix大约 11 年前
SBCL or CMUCL -- Lisp compilers written in Lisp.
collyw大约 11 年前
Slight tangent to your question, but one thing I have noticed recently is that having to deal with really crap code inspires me to do my own better.<p>I inherited a colleagues work after she left, and it was horrible. But I thought about why it was horrible, and how to make it better. <i>What would it look like if it was done well?</i><p>Even with my own code, if I look at something I did 6 months ago, and it doesn&#x27;t make sense straight away, the it can usually be improved.
评论 #7602664 未加载
redox_大约 11 年前
For all low-level I&#x2F;O details (fflush&#x2F;fsync&#x2F;fsyncdata on files&#x2F;directories after creation&#x2F;renaming), I&#x27;ve used to read MySQL routines, pretty simple to understand: <a href="https://github.com/twitter/mysql/tree/31d6582606ddf4db17ad77b8f427674c1e5a05dd/mysys" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;twitter&#x2F;mysql&#x2F;tree&#x2F;31d6582606ddf4db17ad77...</a>
paulrademacher大约 11 年前
Any suggestions for smaller codebases? A lot of these are great and you&#x27;ll pick up idioms here and there, but they&#x27;re <i>massive</i>.
评论 #7606995 未加载
riffraff大约 11 年前
Not a specific codebase, but I went through &quot;Code Reading&quot;[0] many years ago, I found it interesting. Most reviews are not very positive though, so maybe it was just at the right point for me.<p>[0] <a href="http://www.amazon.com/Code-Reading-Open-Source-Perspective/dp/0201799405" rel="nofollow">http:&#x2F;&#x2F;www.amazon.com&#x2F;Code-Reading-Open-Source-Perspective&#x2F;d...</a>
twelvechairs大约 11 年前
The most interesting things to read are those where a programmer has done something cleverly, but this only needs to happen when your language or libraries make it hard for you to begin with. Aside from low-level performance intensive functions, the best code is not interesting to read - it just reads like statements of fact.
Locke1689大约 11 年前
<a href="http://source.roslyn.codeplex.com/" rel="nofollow">http:&#x2F;&#x2F;source.roslyn.codeplex.com&#x2F;</a> for high performance, immutable C# code.<p>You&#x27;ll see some differences from more relaxed C# projects (e.g., we avoid allocations like the plague), but I&#x27;d say we have pretty good style. ;)
laichzeit0大约 11 年前
Eric S. Raymond wrote a book The Art of Unix Programming [1] that has many &quot;case studies&quot; as well as recommendations of which software&#x2F;RFCs are particularly worthy of study.<p>[1] <a href="http://www.faqs.org/docs/artu/" rel="nofollow">http:&#x2F;&#x2F;www.faqs.org&#x2F;docs&#x2F;artu&#x2F;</a>
评论 #7608563 未加载
agentultra大约 11 年前
Anything you find interesting or find yourself using frequently.<p>A less glib answer try Brogue: <a href="https://sites.google.com/site/broguegame/" rel="nofollow">https:&#x2F;&#x2F;sites.google.com&#x2F;site&#x2F;broguegame&#x2F;</a><p>A very interesting roguelike with interesting constraint-based features.
borntyping大约 11 年前
Python: Flask (and related projects)
nicholassmith大约 11 年前
I had a read through the PCSX2 emulator recently, that was quite interesting: <a href="https://github.com/PCSX2/pcsx2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;PCSX2&#x2F;pcsx2</a> it&#x27;s a complex project in what was surprisingly readable C++ code.
budu3大约 11 年前
The old jQuery 1.6.2 code by John Resig is a good start for studying good JavaScript coding practices <a href="http://robflaherty.github.io/jquery-annotated-source/" rel="nofollow">http:&#x2F;&#x2F;robflaherty.github.io&#x2F;jquery-annotated-source&#x2F;</a>
vishnugupta大约 11 年前
I&#x27;m fascinated by concurrent programming. I find that reading classes from Java&#x27;s java.util.concurrent package gives me very good practical insights as to what goes into building a concurrent class. My all time favorite is ConcurrentHashMap :)
diegoloop大约 11 年前
I made this tool: <a href="http://codingstyleguide.com" rel="nofollow">http:&#x2F;&#x2F;codingstyleguide.com</a> to improve the way I code for different languages and not get lost with too much programming information and it&#x27;s helping me a lot.
rasur大约 11 年前
Anything by Fabrice Bellard (Google him, it&#x27;s worth it).
dfkf大约 11 年前
OpenSSL
DonHopkins大约 11 年前
The original source code to Zork in MDL. It doesn&#x27;t matter if you don&#x27;t know MDL. It&#x27;s such beautiful code that it just explains itself to you. And if you&#x27;ve played Zork, it&#x27;s like being invited to explore the underground backstage areas of Disneyland.<p><a href="http://simh.trailing-edge.com/games/zork-mdl.zip" rel="nofollow">http:&#x2F;&#x2F;simh.trailing-edge.com&#x2F;games&#x2F;zork-mdl.zip</a>
chris_wot大约 11 年前
It&#x27;s not great code (though I&#x27;m working to make it so), and perhaps not the intent of this question - but if you want to looking at a 25+ year old codebase that&#x27;s being refactored, check out LibreOffice, especially the VCL component:<p><a href="http://cgit.freedesktop.org/libreoffice/core/log/vcl/" rel="nofollow">http:&#x2F;&#x2F;cgit.freedesktop.org&#x2F;libreoffice&#x2F;core&#x2F;log&#x2F;vcl&#x2F;</a>
twunde大约 11 年前
For PHP, I&#x27;ve been very impressed by Phabricator&#x27;s code (and the related phutils library). It&#x27;s worth looking at the git commits as well to see just how clean and structured commits can be. I&#x27;m much more impressed by it than by any PHP framework code I&#x27;ve read (and I&#x27;ve read Zend, Symfony2, li3, codeigniter as well as custom frameworks)
评论 #7604379 未加载
tlrobinson大约 11 年前
Lots of great suggestions here, but I&#x27;m interested in <i>how</i> you go about reading source code, especially very large codebases?
评论 #7605203 未加载
评论 #7605684 未加载
ddz大约 11 年前
Find yourself a copy of this. Not only did it play a crucial role in the history of the UNIX&#x2F;Linux world, it is a gold mine for understanding operating systems. <a href="http://en.wikipedia.org/wiki/Lions%27_Commentary_on_UNIX_6th_Edition,_with_Source_Code" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lions%27_Commentary_on_UNIX_6th...</a>
j_s大约 11 年前
In the .NET world, shanselman has a series of <i>Weekly Source Code</i> blog posts and most recently posted a list of seven &#x27;interesting books about source and source code&#x27;.<p><a href="http://www.hanselman.com/blog/CategoryView.aspx?category=Source+Code" rel="nofollow">http:&#x2F;&#x2F;www.hanselman.com&#x2F;blog&#x2F;CategoryView.aspx?category=Sou...</a>
tuxguy大约 11 年前
There is a good book on this theme <a href="http://aosabook.org/en/index.html" rel="nofollow">http:&#x2F;&#x2F;aosabook.org&#x2F;en&#x2F;index.html</a><p>, where the authors actually go deep into the design &amp; architecture of selected <i>well designed</i> open source projects e.g. llvm, git, freeswitch, etc.<p>Highly recommended !
nextos大约 11 年前
I think 2 suggestions by plinkplonk in the original thread would be still relevant:<p>Common Lisp - &quot;Paradigms of Artificial Intelligence Programming&quot; by Peter Norvig and &quot;On Lisp&quot; by Paul Graham<p>C - &quot;C Interfaces and Implementations&quot;<p>Minix 1 and XMonad are also very good suggestions too.
Hydraulix989大约 11 年前
C -&gt; nginx C++ -&gt; Chrome
评论 #7602795 未加载
评论 #7602517 未加载
zengr大约 11 年前
If you are into java, ElasticSearch is very nicely written by Shay Banon.<p><a href="https://github.com/elasticsearch/elasticsearch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;elasticsearch&#x2F;elasticsearch</a>
Confusion大约 11 年前
<a href="https://stackoverflow.com/questions/9603/what-is-some-great-source-code-to-read" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;9603&#x2F;what-is-some-great-...</a>
davedx大约 11 年前
* BackboneJS<p>* UnderscoreJS
评论 #7602760 未加载
评论 #7604070 未加载
lightyrs大约 11 年前
I find anything by <a href="https://github.com/jashkenas" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jashkenas</a> to be transparent and enlightening.
rabino大约 11 年前
<a href="https://github.com/norman/friendly_id" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;norman&#x2F;friendly_id</a><p>To learn how to document code.
maccard大约 11 年前
I&#x27;m interested in Game Development, specifically physics simulation and graphics programming. The box2D code (C) is fantastic.
db48x大约 11 年前
TeX the Book is good, even if it is in Pascal.
qwerta大约 11 年前
For Java I highly recommend H2 SQL DB. It has everything (parsers, sockets, webui...) in very tight and nice package.
snarfy大约 11 年前
If you are interested in rendering engines I suggest Irrlicht. It&#x27;s fairly clean and easy to understand.
s_dev大约 11 年前
I&#x27;ve heard that reading the Git source code is very beneficial but haven&#x27;t done it myself yet.
raju大约 11 年前
Any suggestions for Clojure projects?<p>[Update: Oops. I missed the &quot;Clojure -&gt; Core&quot; by jacquesm]
评论 #7603222 未加载
eadler大约 11 年前
FreeBSD kernel &amp; userland
DonHopkins大约 11 年前
I highly recommend checking out <a href="http://voxeljs.com" rel="nofollow">http:&#x2F;&#x2F;voxeljs.com</a> for some beautifully factored JavaScript npm packages, that implement a lot of Minecraft and more in the browser.<p>Max Ogden&#x27;s talk (the first video on that page, also here: <a href="https://www.youtube.com/watch?v=8gM3xMObEz4" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=8gM3xMObEz4</a> ) about how voxeljs and browserify work is inspirational, and his energy, motivation, deep understanding and skill, thirst for learning, reading other people&#x27;s code, building on top of it, and sharing what he built and learned, is extremely contagious!<p>You may want to pause the video frequently and take notes -- there is so much great information in there, and he covers a hell of a lot of amazing stuff.<p>And the source code is really nicely broken up into lots of little npm modules that you can plug together to make all kinds of cool stuff.<p>This stuff is a great fun starting point for teenagers or students to learn how to program and create their own games and web applications, or master programmers to learn the node.js &#x2F; npm ecosystem and idioms. There are some great ways for new and non-programmers to get into it.<p>He says &quot;Everyday I work on it I get more motivated to work on it&quot; -- and you will too!<p>What you will be benefitting from by watching his video and reading his code, is the fact that he actually did a survey of a HUGE amount of code, and took the best, read it, learned from it, rewrote it, and built on top of it.<p>&quot;So many people have written voxel stuff, that I should just copy them.&quot; He used github search, and searched for minecraft, filtered by javascript, and went through ALL 23 PAGES of projects! He cloned ALL the repos he found, and read the ones that seemed promising, cloned them, got them running, understood how they worked.<p>A lot of them were the classic genius programmer projects, really impressive visually, super hard to understand, a giant lib folder with 50 files, everybody writing their own 3d engine.<p>Then he found out about three.js, and learned that, and combined all the stuff he had seen on top of it, including a PhD project in computational geometry that showed how to efficiently implement minecraft with three.js, for removing interior faces, etc.<p>So he learned from and built on top of all that great stuff, and made voxel.js and an insane amount of demos. Now the community has written a whole bunch of nice modular node.js npm modules and demos, that browserify can combine them together into a package that runs in the browser.<p>My only trivial beef with it is that their style guide says not to use trailing semicolons! That makes emacs very irritated and it breaks out in a rash.<p>But other than that, the code is very clean and modular and comprehensible, and opened my mind to a lot of stuff that I didn&#x27;t realize was possible.
RhysU大约 11 年前
FFTW.
visualR大约 11 年前
Xournal
sillysaurus3大约 11 年前
== Vim or Emacs ==<p>Just pick one and force yourself to use it to the exclusion of other editors. Future you will thank you later, because you&#x27;ll still be using it 20 years from now. &quot;We are typists first, programmers second&quot; comes to mind. You need to be able to move chunks of code around, substitute things with regexes, use marks, use editor macros, etc.<p>== 6.824: Distributed Systems ==<p><a href="http://pdos.csail.mit.edu/6.824-2013/" rel="nofollow">http:&#x2F;&#x2F;pdos.csail.mit.edu&#x2F;6.824-2013&#x2F;</a> Do each lab. Read the discussion and rtm&#x27;s course notes.<p>== Tarsnap ==<p><a href="https://www.tarsnap.com/download.html" rel="nofollow">https:&#x2F;&#x2F;www.tarsnap.com&#x2F;download.html</a> How to write C. Study the &quot;meta,&quot; that is, the choice of how the codebase is structured and the ruthless attention to detail. Pay attention to how functions are commented, both in the body of the function and in the prototypes. Use doxygen to help you navigate the codebase. Bonus: that&#x27;ll teach you how to use doxygen to navigate a codebase.<p>== xv6 ==<p><a href="http://pdos.csail.mit.edu/6.828/2012/xv6.html" rel="nofollow">http:&#x2F;&#x2F;pdos.csail.mit.edu&#x2F;6.828&#x2F;2012&#x2F;xv6.html</a><p><a href="http://pdos.csail.mit.edu/6.828/2012/xv6/xv6-rev7.pdf" rel="nofollow">http:&#x2F;&#x2F;pdos.csail.mit.edu&#x2F;6.828&#x2F;2012&#x2F;xv6&#x2F;xv6-rev7.pdf</a><p><a href="http://pdos.csail.mit.edu/6.828/2012/xv6/book-rev7.pdf" rel="nofollow">http:&#x2F;&#x2F;pdos.csail.mit.edu&#x2F;6.828&#x2F;2012&#x2F;xv6&#x2F;book-rev7.pdf</a><p>Read the book. Force yourself to read it in its entirety. Use the source code PDF to study how to turn theory into practice.<p>== Arc ==<p><a href="http://ycombinator.com/arc/arc3.1.tar" rel="nofollow">http:&#x2F;&#x2F;ycombinator.com&#x2F;arc&#x2F;arc3.1.tar</a><p>You&#x27;re not studying Arc to learn Arc. You&#x27;re studying Arc to learn how to implement Arc. You&#x27;ll learn the power of anaphoric macros. You&#x27;ll learn the innards of Racket.<p>Questions to ask yourself: Why did Racket as a platform make it easier to implement Arc than, say, C&#x2F;Golang&#x2F;Ruby&#x2F;Python? Now pick one of those and ask yourself: what would be required in order to implement Arc on that platform? For example, if you say &quot;C,&quot; a partial answer would be &quot;I&#x27;d have to write my own garbage collector,&quot; whereas for Golang or Lua that wouldn&#x27;t be the case.<p>The enlightenment experience you want out of this self-study is realizing that it&#x27;s very difficult to express the ideas embodied in the Arc codebase any more succinctly without sacrificing its power and flexibility.<p>Now implement the four 6.824 labs in Arc. No, I&#x27;m not kidding. I&#x27;ve done it. It won&#x27;t take you very long at this point. You&#x27;ll need to read the RPC section of Golang&#x27;s standard library and understand how it works, then port those ideas to Arc. Don&#x27;t worry about making it nice; just make it work. Port the lab&#x27;s unit tests to Arc, then ensure your Arc version passes those tests. The performance is actually not too bad: the Arc version runs only a few times slower than the Golang version if I remember correctly.<p>== Matasano crypto challenges ==<p><a href="http://www.matasano.com/articles/crypto-challenges/" rel="nofollow">http:&#x2F;&#x2F;www.matasano.com&#x2F;articles&#x2F;crypto-challenges&#x2F;</a> Just trust me on this one. They&#x27;re cool and fun and funny. If you&#x27;ve ever wanted to figure out how to steal encrypted song lyrics from the 70&#x27;s, look no further.<p>== Misc ==<p>(This isn&#x27;t programming, just useful or interesting.)<p>Statistics Done Wrong <a href="http://www.statisticsdonewrong.com/" rel="nofollow">http:&#x2F;&#x2F;www.statisticsdonewrong.com&#x2F;</a><p>A Mathematician&#x27;s Apology <a href="http://www.math.ualberta.ca/mss/misc/A%20Mathematician&#x27;s%20Apology.pdf" rel="nofollow">http:&#x2F;&#x2F;www.math.ualberta.ca&#x2F;mss&#x2F;misc&#x2F;A%20Mathematician&#x27;s%20A...</a><p>Surely You&#x27;re Joking, Mr. Feynman <a href="http://web.archive.org/web/20050830091901/http://www.gorgorat.com" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20050830091901&#x2F;http:&#x2F;&#x2F;www.gorgora...</a><p>Zen and the Art of Motorcycle Maintenance <a href="http://www.arvindguptatoys.com/arvindgupta/zen-motorcycle.pdf" rel="nofollow">http:&#x2F;&#x2F;www.arvindguptatoys.com&#x2F;arvindgupta&#x2F;zen-motorcycle.pd...</a><p>== Above All ==<p>Don&#x27;t fall in love with studying theory. Practice. Do what you want; do what interests you. Find new things that interest you. Push yourself. Do not identify yourself as &quot;an X programmer,&quot; or as anything else. Don&#x27;t get caught up in debates about what&#x27;s better; instead explore what&#x27;s possible.
评论 #7603028 未加载
评论 #7602592 未加载
评论 #7608481 未加载
评论 #7602530 未加载
评论 #7602696 未加载
评论 #7604932 未加载
评论 #7605776 未加载
评论 #7607976 未加载
评论 #7607025 未加载
评论 #7606986 未加载
评论 #7608217 未加载
marincounty大约 11 年前
Get to know the command line before you start any language.
dschiptsov大约 11 年前
nginx&#x2F;src&#x2F;os&#x2F;unix&#x2F;<i>
评论 #7607335 未加载
plicense大约 11 年前
Everything at Google.