- Paperback: 528 pages
- Publisher: Addison-Wesley Professional; 1 edition (June 6, 2003)
- Language: English
- ISBN-10: 0201799405
- ISBN-13: 978-0201799408
- Product Dimensions: 7.3 x 1.2 x 9 inches
- Shipping Weight: 2 pounds (View shipping rates and policies)
- Average Customer Review: 3.4 out of 5 stars See all reviews (18 customer reviews)
- Amazon Best Sellers Rank: #1,184,504 in Books (See Top 100 in Books)
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
Code Reading: The Open Source Perspective (v. 1) 1st Edition
Use the Amazon App to scan ISBNs and compare prices.
Frequently bought together
Customers who bought this item also bought
From the Back Cover
If you are a programmer, you need this book.
- You've got a day to add a new feature in a 34,000-line program: Where do you start? Page 333
- How can you understand and simplify an inscrutable piece of code? Page 39
- Where do you start when disentangling a complicated build process? Page 167
- How do you comprehend code that appears to be doing five things in parallel? Page 132
You may read code because you have to--to fix it, inspect it, or improve it. You may read code the way an engineer examines a machine--to discover what makes it tick. Or you may read code because you are scavenging--looking for material to reuse.
Code-reading requires its own set of skills, and the ability to determine which technique you use when is crucial. In this indispensable book, Diomidis Spinellis uses more than 600 real-world examples to show you how to identify good (and bad) code: how to read it, what to look for, and how to use this knowledge to improve your own code.
Fact: If you make a habit of reading good code, you will write better code yourself.
About the Author
Diomidis Spinellis has been developing the concepts presented in this book since 1985, while also writing groundbreaking software applications and working on multimillion-line code bases. Spinellis holds an M.Eng. degree in software engineering and a Ph.D. in computer science from Imperial College London. Currently he is an associate professor in the Department of Management Science and Technology at the Athens University of Economics and Business.
If you are a seller for this product, would you like to suggest updates through seller support?
Top Customer Reviews
The examples are at the beginning easy and gets higher as more as you read. I think, it is good for programmers to know the book, because it shows some problems which aren't told at school.
I haven't read it to the last side until now, but I'm reading it side by side and hope to finish it until summer ;-)
Unfortunately, I feel that this book was of very limited use to me as an experienced programmer, and suffers from a rather basic flaw (as a topic). The problem is that the art of code reading is really the intersection of a deep and/or broad understanding of programming, in conjunction with a deep and/or broad understanding of the tools and practices employed. One could well assert that this book is about *debugging* unfamiliar codebases as much as it is about *reading* them, since code comprehension is a component of code debugging. This is a rather apt analogy, since many have attempted to describe the black art of debugging just as Mr. Spinellis has attempted with reading, and with no definitive "must-have" coverage to date.
The result is that I felt the book rushed through important programming concepts that were either extremely basic (global variables, while loops, conditionals, blocks), or language-specific (C typedef, arrays, function pointers), or too deep for the book to address adequately (trees, stacks, queues, hashes, graphs). With regard to the latter, I found it odd to be reading a lot of text about basic data structures, when it seemed to me that I should be assumed to already have this knowledge if I wanted to read code that used it. And if I did NOT know about basic data structures, I should be reading a book about data structures rather than a book about code reading. Software patterns are also presented (though not by the name, I think). If I was to encounter a codebase that employed some programming concept I didn't understand fully (for example, red-black trees), then I would first go to a book on data structures -- not a book on code reading.
Following the sections on what I would consider mandatory prerequisite understanding are some brief chapters software engineering concepts (version control, build systems, project organization, packaging, system structures), which might be useful to a reader who had never worked on a large-scale project before.
After all of the coverage of what I would consider prerequisite knowledge, the penultimate chapter finally gets to the topic of tools and techniques for actually reading code. This chapter is in fact what I had hoped Mr. Spinellis would devote the book to. Unfortunately, most of the tools and techniques presented are very basic and quickly encountered by any programmer: regular expressions, the fact that many editors include browsing support, the grep utility, differencing tools, the idea that you could write your own tools, using the compiler to emit warnings and preprocessed code, that beautifiers exist, profiling and annotating printouts. And that's it, in about forty pages, followed by a chapter devoted to an example session.
On the whole, I think this book comes up short. If you have a few years of programming experience under your belt, then you've already encountered the basic tools and techniques presented. If someone resorted to this book to learn about a basic programming construct, then they could read my code, but I'd be nervous about letting them modify it, until they read more focused texts.
I'm rating this book at three stars because there are some good pieces here and the effort was laudable. In the end, though, I really don't think that anybody needs this book on their shelf.
Contents: Introduction; Basic Programming Elements; Advanced C Data Types; C Data Types; Advanced Control Flow; Tackling Large Projects; Coding Standards and Conventions; Documentation; Architecture; Code-Reading Tools; A Complete Example; Outline Of The Code Provided; Source Code Credits; Referenced Source Files; Source Code Licences; Maxims for Reading Code; Bibliography; Index; Author Index
Some of the material is universal regardless of your platform of choice... why it's important to be able to read code, how basic program flow determines the "narrative" of the program, etc. He uses little icons in the side bar (an "i" and an exclamation point) to point out common programming idioms as well as dangerous techniques that might not work as first expected. On the flip side, a lot of the examples use C or C++ code to demonstrate some example that may only be of interest to you if you use those languages. Diving into malloc and the intricacies thereof might allow you to understand some concepts, but it might be a bit difficult to extract out the applicable material if you're not using the C family of languages. Likewise, using Perl or grep to examine source code is great if you know Perl or grep, but you may be tempted to skim large portions of those chapters if those are not your skill sets...
So would I recommend the book? Probably... but your impression of the book will likely depend on how close you match the skill sets talked about and used in the book. Even if you don't qualify as a Unix geek, you can still get value here... you'll just have to work a bit harder...
There is no ONE answer to it. The Code Reading is not an easy subject by any means. I do not know of any other book that even tried to attempt at this subject. So, I picked this one with out even thinking twice.
The first reaction when I read the book is "what the he... is this all about" :-). I guess, it is the same reaction I had got many times reading and understanding code written by others.
Just as in it takes a while to understand and digest a piece of new code you ever come across, it might take a while to get to understand and digest the concepts behind this book. I had to revisit and reread the concepts and apply it to practical situation to be able to grasp the abstractness of the subject in a concrete manner :-).
If you are with me this far, probably this book is for you. Still wondering what the heck is all this about? Here is a simple explanation from myside:
If you LOVE to do coding, HAVE to read the code for a living, WANT to learn *any* TECHNIQUES, then this book is for you!!!