Live data from Hacker News

Ask HN: Where do I find good code to read?

news.ycombinator.com

121–130 of 216 posts

Re: Ask HN: Where do I find good code to read?

#124
When I'm coding / debugging with a framework of some kind (nodejs, dotnet, jdk, wordpress, whatever I'm using to deliver value at the time) I sometimes "step into" the framework or a library to see what happens. (Of course, I need open source for the framework/lib for this to work.) It sometimes opens a window to interesting code to read that's relevant to what I'm thinking about at the time. And sometimes doesn't.

Lots of source these days has auto-documentation comments. Good IDEs present that documentation, which helps guess what might be worth diving into the Step Into rabbithole.

Often, from a high-quality framework / library I learn a bunch about handling weird edge cases and about writing code for long-term maintainability. And, I often learn some useful constructs and techniques. (And, it's possible to learn useful things from not-so-high quality code too.)

Re: Ask HN: Where do I find good code to read?

#126
I would just find a heavily used, well-loved open source codebase used by lots of people in production. You need to define "good"/"bad" as actual objective qualities you can see in the world.

I would look for places the code seems to be really liked by its users. Maybe its very reliable, or extensible, or fast, or something else. How do they achieve that? Why do the users say these things? How do they measure / focus / make tradeoffs to focus on those attributes?

Then for painful to use software & common painpoints, why does this happen? Is it a fundamental design decision? Is it just sloppy code? Is in just intentionally slow to be more user-friendly? Or hard to read code because the focus is on speed?

It's all about the tradeoffs and intentional choices...

Re: Ask HN: Where do I find good code to read?

#127

There was a blog post from Peter Seibel recently called [Code Is Not Literature)]( https://gigamonkeys.com/code-reading/ ) which pointed out that although everyone seems to agree reading code is great, very few tend to do it regularly. I feel like I get a lot more out of messing with / hacking on code than I do from reading it. I'm sure people vary, but I've got loads more out of open source contributions to sometime…

I think the difficulty with this advice is that it's hard to know where the venn diagram overlaps between "having an in" and "good code". A lot of the code I read because I "have an in" is, I think, not very "good" in the sense of being enlightening in furtherance of my craft. It usually just looks like code I'd already write.

I typically find the recommendations people make like "here's an example of particularly good code for this particular language / style / architecture" to be more enlightening.

Re: Ask HN: Where do I find good code to read?

#129
post #102
post #87

Earlier quoted context omitted.

This is what "top down" coding looks like. In "top down" coding you're told what to do by the boss, given too short a timeline, and forced to push something out the door. Congratulations on figuring out how to create a massive churn rate among your actual good engineers.

Give me engineers who value solving problems, sometimes with code, over “good” engineers every single day of the week.

I understand you're characterizing the word "good" as some bad definition of "good" used by some subset of others, but your quotation marks are doing a Herculean amount of lifting (i.e. it's hard to tell what you're saying). I think most people would consider "engineers who value solving problems" as "good" and vice versa.
Post reply on HN