Live data from Hacker News

Ask HN: What code do you frequently read?

news.ycombinator.com

21–30 of 64 posts

Re: Ask HN: What code do you frequently read?

#21
post #11

I pretty much read the code for every dependency I use. It helps me understand how it works and what the docs are fibbing about. If I can't read the code because it's proprietary, I always strace it to see what it's doing. For me, it makes it easier to reason about the behavior of my program. Currently my favorite code to read includes: key/value databases written in C and other "lower level" languages, and the golan…

Would you mind going into detail about how you use strace in that context? Or about how you learned to do that? That's a very handy skill which I need to learn.

Re: Ask HN: What code do you frequently read?

#24
I read the express.js source quite a few times. I wanted to reason out how one goes from raw node to something like express. I found it well written, but to really understand it I found myself making toy versions of each functionality. http://www.nickstefan.net/blog/view/express-under-the-hood

Re: Ask HN: What code do you frequently read?

#25
post #11

I pretty much read the code for every dependency I use. It helps me understand how it works and what the docs are fibbing about. If I can't read the code because it's proprietary, I always strace it to see what it's doing. For me, it makes it easier to reason about the behavior of my program. Currently my favorite code to read includes: key/value databases written in C and other "lower level" languages, and the golan…

Would you mind going into detail about how you use strace in that context? Or about how you learned to do that? That's a very handy skill which I need to learn.

This should whet your appetite and give you a bit of direction on what to dig deeper into: http://althing.cs.dartmouth.edu/local/reverse-talk.pdf

Re: Ask HN: What code do you frequently read?

#26
When I feel burnt out, I find it refreshing to take a break and look at something I've already accomplished. Sometimes that means source code I've written.

Looking through my code reminds that I can do hard things. I can solve hard problems, even elegantly. Other times it reminds me how painful a project was to finish or I chuckle at how BAD of a coder I was back then compared to now. It helps me feel like I'm making progress despite the relentless stack of issues, problems, and assignments.

And when I do feel motivated to be a better coder, I try to explain somebody else's source code to somebody else. It helps me be a better reader and writer.

Re: Ask HN: What code do you frequently read?

#27
post #8

My goal is to complete a game in C++ using SDL2 this year, so i've been reading a ton of that on Github just to see how other people do it.

This is actually one of my goals too. If I can recommend, the godot engine[https://github.com/okamstudio/godot] is my main source of inspiration and learning.

Re: Ask HN: What code do you frequently read?

#28
post #6

If I am returning to a piece of code frequently it's not because the code is good, but because the documentation is bad.

Or because the code is bad and you keep getting issues because of it.

I think some of the best code I use is that which I don't look at frequently, because it means it's behaving well on its own / in concert with other components, and is abstracted enough that it doesn't require changes.

Re: Ask HN: What code do you frequently read?

#29
I used to read the Neo4j source (I wanted to write my own graph database). Then I was always reading the Django ORM source as reference for a Neo4j / Django ORM integration I was working on (https://github.com/scholrly/neo4django).

I've found that diving into a code base is a great way to learn about a new topic or language, and to get rid of the "magic".

Post reply on HN