code-reading

What is some great source code to read?

Following the advice of Scott Hanselman, I'm looking for good source code to read. Here's what is currently on my list: Scott's posts CodeProject How about you? What source code do you read? It doesn't have to be .NET related. Update Compiled replies: Beautiful Code Donald Knuth's literate programs CodePlex Linux SQLite Java J...

Simplest "Oh duh!" moment when looking at others' source

When have you found something that gave you pause and made you realize that more cooks in the kitchen is sometimes a good thing? Specifically, simple things you've seen that made you wonder why you never thought of them before. ...

Where can I read good code? Any resources for that?

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? ...

Generic Exception Handling in Python the "Right Way"

Sometimes I find myself in the situation where I want to execute several sequential commands like such: try: foo(a, b) except Exception, e: baz(e) try: bar(c, d) except Exception, e: baz(e) ... This same pattern occurs when exceptions simply need to be ignored. This feels redundant and the excessive syntax causes it t...

How do I start reading the PHP source code?

The source code for the PHP interpreter is absolutely mystifying to me. The thing is, I'd like to learn more about it, so I can avoid making Schlemiel-style mistakes. This is a huge project, some nearly sixty megs in size. How do I go about reading it? Is there an article or a book out there somewhere to help me begin to make some se...

Good techniques for understanding someone else's code

What techniques can anyone suggest for understanding a new piece of code? Here are some of the things I find sort-of work: 1) Print the code out, on a colour printer, with syntax highlighting, single sided. Spread it out on a desk. Then go through it: a) Highlighting start of functions and 'blocking off' large statements. b) Highlighti...

Whose code do you read because it's fun, useful and educational?

Whose code do you read because it's fun, useful and educational? For example, I am really liking Peter Norvig's code. His python samples (Solving Every Sudoku Puzzle, How to Write a Spelling Corrector) are short and beautiful. Plus, I am currently reading Paradigms of Artificial Intelligence Programming, which is full of insights. So, ...

How to read source code of Rails sample project?

Reading source code of sample projects, such as Beast and Bort, are recommended as a good way to learn rails. But I found myself getting lost in reading source code of these projects, cause the included plugins might bring in some strange code without any hint, such as "require" or "include". Could you share your rails code reading exper...

Is there good source code related to web development to learn from?

I've recently read Code Reading and found that if I wanted to grow my skills as a software developer it would be useful for me to read more code. I'm currently working in the world of mod_perl, apache, unix, mysql, javascript and xslt (some sort of LAMP I guess). I would like to find great literature of source code in these fields whic...

Good code to read?

Lurking around on Stack Overflow, I have seen a couple of comments like "reading code is better than reading codes" and "join open source projects and read other people's code, that will teach you". So I decided I would start doing that on weekends (read and analyze famous and tested code). After watching Linus Torvalds talk about git ...

How do you read an existing Rails project?

When you start working on an existing Rails project what are the steps that you take to understand the code? Where do you start? What do you use to get a high level view before drilling down into the controllers, models, helpers and views? Do you have any specific techniques, tricks or tools that help speed up the process? Please don...

Good examples of C applications?

Everyone knows that C is hard to program in, provides you with almost no useful abstractions, and is even dangerous. However, given enough design and discipline, it's possible to write clean, portable, modular code. What are some good examples of this? I'm looking for real world applications or other open source projects that are reasona...

Best practices for pronouncing C code

As my formal education in programming pre-dates C, I learnt C from K&R and other texts. Are there helpful conventions for vocalising C code when reading and writing it? For example, in d = emalloc(sizeof(*d)); d->d_name = estrdup(name); is '=' best read as 'is set to' or 'equals' or something else? Would '==' then be read as 'equ...

What are some small, fast and lightweight open source applications (µTorrent -esque)?

Possible duplicate What is the best open source example of a lightweight Windows Application? µTorrent is a small bit-torrent client, a really small one. It doesn't come with an installer, just a exe, you drop in your PATH somewhere. It's super lightweight and yet feature rich. Plus it is the work of one man. It's also close...

What are the skills needed to read and understand other people's code?

Hi, I have got a new job, and in this job I need to go through other people's code to understand the application. What are the skills which I must acquire to accomplish the task of reading and understanding other people's code? What best-practices should I follow while reading and understanding other people's code? Which books or on...

What is the best approach to reading and understanding the code of a large scale project?

Say you decide to work on Open Source Software and you are faced with a project with millions of lines of source code, what do you do? What are the best methods to tackling this project and getting a good understanding in the shortest possible amount of time. I'm constantly facing new code bases and am curious to find out what approaches...

code-reading books

I have been hanging around Borders (the bookstore) lately and have seen some books about "code reading". It covers topics like how to read code and understand it effectively, and how to (if required) refactor it to make reading the code easier. My questions is this: Are these books any good for an experienced programmer (2 years+) and ...

I want to start reading the Python source code. Where should I start.

I want to start reading the Python source code. My experience, I know Python and Java very well. I know some other languages at various levels of proficiency, but neither C/C+/ particularly well. I studied C in college, but have never professionally programmed in it. My Reasons for reading this code. Understand how python works unde...

Good C code to read for learning

To learning a language it is recommended to read some good code written in it. I want to recommend to friend some good C code to read. What projects are suitable online for reading good code? Criteria: Written in good style Well documented (both externally and internally if possible) Real-world, not tutorial-level or introductory book...

Design and Readbility.

Hi all, I am working on a project written in C++ which involves modification of existing code. The code uses object oriented principles(design patterns) heavily and also complicated stuff like smart pointers. While trying to understand the code using gdb,I had to be very careful about the various polymorphic functions being called by the...