tags:

views:

652

answers:

10

I read lot of articles saying that "Reading others code will helps you to be a better programmer". But where can I read good code and bad code so that I can learn how to and how not to code. If you have any resources that would be helpful?

A: 

Active open source projects would be a good starting point for good code: www.sourceforge.net

Adam Driscoll
A: 

Get yourself a subversion client (TortoiseSVN is good) and check out SourceForge.

It's not just about reading good code, it's about being able to spot good versus bad code and thinking about the reasons it is good or bad. Good question!

Ash
+4  A: 

Beautiful Code: Leading Programmers Explain How They Think

Some of the code in this book is sublime; almost all if it is interesting and worth studying...

Kevin Little
I read this book. You can see lot of good code in the book. Thanks.
amadamala
+6  A: 

You can have a look at : Scott Hanselman's - Weekly source code - this week he's talking about google's browser but if you go a bit back you'll find C# projects.

PS:(I assume you meant C# as you didn't specify).

sirrocco
A: 

Here is an example of real bad code bad code the rest of the site is good code

Yitzchok
+1  A: 

For the good code part, Scott Hanselman's Weekly Source Code is a great resource in finding out cool code in various .NET technologies.

For the bad code part, subscribe to The Daily WTF for your daily dose of curious perversions of technology(tm).

Jon Limjap
A: 

Find a reasonably sized open-source project that tickles your fancy and fix some bugs or find something to add to it. Diving into a large software project is fairly daunting at first. You may find yourself having no clue what's going on, but don't worry, that's normal. First try modifying the code by adding some print statements to give you hints about what it's doing. If it's something that's easily used in a debugger, try stepping through the areas you've targeted to modify. It's reasonable to expect to spend weeks without actually making a productive change. You'll have lots of false starts and dead-ends, but the process of learning how a software package works is extremely valuable.

bmdhacks
+1  A: 

Related discussion "What are some great source code to read?"

John
+1  A: 

Just browse around github and see if you find something that interests you.

I found that reading any kind of code will most likely reflect on your own coding style. It's not that important whether it's good code or bad code, since that's mostly depending on the use case and who judges.

Just become someone with an opinion, try to improve yourself and try to help others, join the IRC channel for some of the areas in programming that interest you and be sure to find people you can help, and in turn others will help you, peer review is just as powerful as reading.

You may find reading the article at Danny O'Brien's Blog - on being a bit of an idiot

manveru
A: 

I recently discovered that the source for Residual is a darn good read. It's a project to make Grim Fandango playable on modern systems, and the developers have a lot of good practices going on.

Josh Matthews