Live data from Hacker News

Ask HN: What source code is worth studying?

news.ycombinator.com

81–90 of 176 posts

Re: Ask HN: What source code is worth studying?

#81
post #65

Earlier quoted context omitted.

>Do not identify yourself as "an X programmer," or as anything else. Yet every single programming job post these days is basically looking for someone with X years of experience in a long enumeration of specific technologies. The usual reason being "They need to be productive. Now."

I think that is also because hiring is generally busted, and recruiters who are not programmers don't know what else to ask.

I totally agree with you that hiring is busted. I have done a lot of phone screens over the past few years and I make a point to ask only technical questions in order to weed out the the 56% of programming noobs who just want to make a million dollars and cash out.

However, I've noticed over this same time period that these screeners stumble into the office for a follow-up interview like giant toddlers: disheveled, incoherent, and totally self-involved. I wish this stereotype of the socially-awkward-yet-brilliant hacker would die in flames because it is not reality (or at best 2% of the community). Instead, this cultural delusion is convincing the socially awkward masses to seek out a job that is mostly about working closely with others, communicating constantly, and continuous compromise.

I have children in their 20's and I've seen how hard it can be to find your calling in life, but just because 99% of douche-bags earn a spot on reality tv that doesn't mean all stereotypes are true. Don't choose a job that you think fits your personality but that actually requires you to behave differently because you'll be miserable.

Re: Ask HN: What source code is worth studying?

#82
post #63

C -> nginx C++ -> Chrome

When you read any C++ codebase remember that there are many dialects and so just because something is a good idea in one doesn't mean that it is in another and that you should prefer that way without understanding the reasoning behind it.

[deleted]

Re: Ask HN: What source code is worth studying?

#84
post #80

== Vim or Emacs == Just pick one and force yourself to use it to the exclusion of other editors. Future you will thank you later, because you'll still be using it 20 years from now. "We are typists first, programmers second" comes to mind. You need to be able to move chunks of code around, substitute things with regexes, use marks, use editor macros, etc. == 6.824: Distributed Systems == http://pdos.csail.mit.edu/6.8…

> == Tarsnap == > How to write C. Study the "meta," 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. I just had another look at the tarsnap source code, and while I know Percival is a great guy, and I can't imagine him suing over "mis-use", the bulk of the code is unde…

Relax

Re: Ask HN: What source code is worth studying?

#88
post #87

Python Sudoku Solver by Peter Norvig -- an elegant solution in one page of code. When I read this, I felt like code is art. http://norvig.com/sudoku.html

Tangential, but entertaining, is the TDD Sudoku http://devgrind.com/2007/04/25/how-to-not-solve-a-sudoku/

As Ravi said:

Ron Jeffries attempts to create a sudoku solver – here, here, here, here and here. (You really ought to read these articles. They are ummm…{cough} …err…. enlightening.)

Peter Norvig creates a Sudoku Solver.

Compare. Learn.

http://ravimohan.blogspot.se/2007/04/learning-from-sudoku-so...

Re: Ask HN: What source code is worth studying?

#89
I suggest the source code of TeX. Not new, but still very interesting to read.

source that needs some postprocessing (tangle/weave):

http://mirrors.ctan.org/systems/knuth/dist/tex/tex.web

PDF from the source (including hyperlinks)

https://www.tug.org/texlive/devsrc/Master/texmf-dist/doc/gen...

Re: Ask HN: What source code is worth studying?

#90
post #9

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. I never seem to get enough motivation to read deeply into random "grand" code bases like Lua or SQLLite, but some months ago I got into the…

I really enjoy doing this as well. Are you aware of any resources or metrics (number of contributors on github, etc.) to find which projects are "well crafted" in X framework/language?

Perhaps I overestimate how much risk there is in learning idiomatic practices from a project which is not actually all that idiomatic. I like the assurance that what I read is quality, especially with frameworks or languages I'm very new to where it can be tough to tell.

Post reply on HN