Skip to content

Comment on Reading Other People's Code

Comments

This is a great idea. And I think that leads to a broader question I've had.

I completed a 10-week programming course (Hackbright) in SF this summer and am currently waiting for my visa to come through to come back to the Bay Area to start a job at a YC company.

There are lots of resources out there for picking up a language (or coding, to begin with), eg, codecademy, treehouse, udemy, even offline courses like Hackbright, DevBootCamp. Beyond that, what are some of the best ways to go from a programmer to a good programmer?

I find writing code a couple hours a day and working on my personal projects helpful, but only to a certain degree as I feel I am re-using a lot of my existing knowledge (or hitting some kind of roadblock).

Hence, reading more quality codes has been one of the priorities for me to keep up the learning. The major challenge though is to find good code to read. Perhaps a weekly curated "reading list" akin to StartupDigest but for coders, instead of startup related articles, they can be handpicked "codes of the week" on github / other sources? Or, do these things already exist out there?

The major challenge though is to find good code to read.

In my experience, reading and working with bad code has proven to be extremely valuable too. Until you realize why something is bad (e.g. extremely long methods), you won't appreciate "good code". So, I suggest picking a medium-sized open source project in a language of your choice and start contributing some bug patches. You will come across plenty of both good and ugly code.

I suggest picking a medium-sized open source project in a language of your choice

Thanks. What's the best way to find medium size (what is considered medium sized) open source project? I code mostly in python and have several repos on github/michellesun.

You've already answered your own question. Start with the code your code already depends on:

https://github.com/michellesun/zuppa-di-bella/blob/master/re...

Flask==0.9 Jinja2==2.6 Pillow==1.7.7 Werkzeug==0.8.3 beautifulsoup4==4.1.1 lxml==2.3.5 pymongo==2.2.1 requests==0.13.3 wsgiref==0.1.2

Surely some of those have open issues. Maybe even issues that would be relevant to your own projects.

Cool. Thanks again. Also just came across this question on stackexchange http://programmers.stackexchange.com/questions/165380/how-to...

Quoting part of the top answer here:

""" Here is a partial list:

Use the language all day, every day. Usually this means being full-time employed in the language.

Read all you can about the language. Especially, "best practices" and idioms.

Join a users group to talk with others about the language and what they do with it.

Work with other people's code! There is no faster way to learn what not to do in a language than to have to clean up after someone did something awful.

Support the code you write - every bug becomes a tour of your worst decisions!

Study computer science and languages in general

Learn a very different language. A great compliment to C would be a functional language like Lisp. This will turn the way you think about your procedural language inside out.

Learn to use the frameworks and APIs available for that language.

Take the time to do your own experiments with the language. SICP is not applicable to C, but the attitude of learning a language by testing its limits is a very productive one.

Read the history of the language to learn why it was made the way it is.

Attend conferences to hear the language authors speak, or to hear what industry leaders are doing with the language.

Take a class in the language. """

We're in the middle of doing some exercises in pintos for school (it's a toy operating system where you're supposed to implement part of the functionality) and I can really recommend the code in it. The documentation is good as well. Operating systems might not be for everyone, but the code is good.

Edit link: http://www.stanford.edu/class/cs140/projects/pintos/pintos.h...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.