Start reading Code Reading: The Open Source Perspective on your Kindle in under a minute. Don't have a Kindle? Get your Kindle here or start reading now with a free Kindle Reading App.

Deliver to your Kindle or other device

 
 
 

Try it free

Sample the beginning of this book for free

Deliver to your Kindle or other device

Code Reading: The Open Source Perspective: Open Source Perspective v. 1
 
 

Code Reading: The Open Source Perspective: Open Source Perspective v. 1 [Kindle Edition]

Diomidis Spinellis
3.7 out of 5 stars  See all reviews (3 customer reviews)

Kindle Price: £31.30 includes VAT* & free wireless delivery via Amazon Whispernet
* Unlike print books, digital books are subject to VAT.

Free Kindle Reading App Anybody can read Kindle books—even without a Kindle device—with the FREE Kindle app for smartphones, tablets and computers.

To get the free app, enter your e-mail address or mobile phone number.

Formats

Amazon Price New from Used from
Kindle Edition £31.30  
Paperback £37.01  
Kindle Daily Deal
Kindle Daily Deal: Up to 70% off
Each day we unveil a new book deal at a specially discounted price--for that day only. Learn more about the Kindle Daily Deal or sign up for the Kindle Daily Deal Newsletter to receive free e-mail notifications about each day's deal.


Product Description

Product Description

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.

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.



0201799405B02032003

Product details

  • Format: Kindle Edition
  • File Size: 5846 KB
  • Print Length: 528 pages
  • Simultaneous Device Usage: Up to 5 simultaneous devices, per publisher limits
  • Publisher: Addison-Wesley Professional; 1 edition (27 May 2003)
  • Sold by: Amazon Media EU S.à r.l.
  • Language: English
  • ASIN: B003YL3OW8
  • Text-to-Speech: Enabled
  • X-Ray:
  • Word Wise: Not Enabled
  • Average Customer Review: 3.7 out of 5 stars  See all reviews (3 customer reviews)
  • Amazon Bestsellers Rank: #913,264 Paid in Kindle Store (See Top 100 Paid in Kindle Store)
  •  Would you like to give feedback on images?


More About the Author

Discover books, learn about writers, and more.

Customer Reviews

4 star
0
2 star
0
1 star
0
3.7 out of 5 stars
3.7 out of 5 stars
Most Helpful Customer Reviews
3 of 3 people found the following review helpful
5.0 out of 5 stars Describing a process... not a miracle. 28 Dec 2006
Format:Paperback
If you are reading this book and expect to understand the second day after how opensource works, you are plain wrong. You should actually stop reading.

But what this book does, it does with style.

It presents you how opensource projects manage to create the best of the breed software, how you can track changes in those projects and understand why some software got the way it is, how can you alter it to fit your needs. It actually gives you valuable insight upon code analysis, and how to get a grip when you have a real big code in front of you and don't know even where to start.

If you will understand that this books explain you a process of creating software (which in no case happends over night) you will love this book... otherwise this will be just another technical book, explaining sometimes apparent obvious stuff.

Because this book has great insights from the years of experience of the author, I can not give it less then 5 stars and suggest it as a required reading for anyone who considers entering the opensource developer's world.
Comment | 
Was this review helpful to you?
23 of 28 people found the following review helpful
3.0 out of 5 stars Unfocused 23 Jun 2003
Format:Paperback
Programmers need to be able to look at code and analyze what it does in order to change it or fix it. The concept behind this book is to use many of the open source code samples to discuss how to read code and how to spot potential trouble areas in code. Unfortunately the book doesn’t stay focused on this single goal and that detracts from its overall value. The book spends too much time explaining the basics of programming instead of concentrating on reading code. It also bounces around from one language to another, from C to C++ to Perl to Java, which is very confusing. For example, if you are a Java programmer do you really care how the C compiler optimizes strcmp calls? And what does that have to do with reading code?
Some of the advice is fairly basic such as try to realign indentations properly and replace complex code structures with simple placeholders when doing analysis. Although there are parts of the book that are excellent, too many of these good parts are wrapped under what should be basic concepts to anyone reading code. How can you debug a Java program, for example, if you are unfamiliar with abstract classes, libraries, or polymorphism? Do you really need a book on code reading to explain basic object oriented programming?
Overall, the book seems very unfocused and I really can’t recommend it.
Comment | 
Was this review helpful to you?
0 of 8 people found the following review helpful
3.0 out of 5 stars Easy code. 29 Aug 2011
Format:Paperback
A wonderful book with some damage on the covering
The CD is a completely repository of code. Many examples and easy to read.
Comment | 
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 3.8 out of 5 stars  19 reviews
73 of 78 people found the following review helpful
3.0 out of 5 stars Cool concept, but disappointing 9 Mar 2004
By Steve Hollasch - Published on Amazon.com
Format:Paperback|Verified Purchase
I purchased the book to help me out with the recurring task of quickly understanding the nature of unfamiliar large software projects. Kudos to Mr. Spinellis for tackling this subject, which is a large part of the everyday work of programming.

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.
62 of 79 people found the following review helpful
3.0 out of 5 stars Unfocused 23 Jun 2003
By Thomas Paul - Published on Amazon.com
Format:Paperback
Programmers need to be able to look at code and analyze what it does in order to change it or fix it. The concept behind this book is to use many of the open source code samples to discuss how to read code and how to spot potential trouble areas in code. Unfortunately the book doesn't stay focused on this single goal and that detracts from its overall value. The book spends too much time explaining the basics of programming instead of concentrating on reading code. It also bounces around from one language to another, from C to C++ to Perl to Java, which is very confusing. For example, if you are a Java programmer do you really care how the C compiler optimizes strcmp calls? And what does that have to do with reading code?
Some of the advice is fairly basic such as try to realign indentations properly and replace complex code structures with simple placeholders when doing analysis. Although there are parts of the book that are excellent, too many of these good parts are wrapped under what should be basic concepts to anyone reading code. How can you debug a Java program, for example, if you are unfamiliar with abstract classes, libraries, or polymorphism? Do you really need a book on code reading to explain basic object oriented programming?
Overall, the book seems very unfocused and I really can't recommend it.
9 of 10 people found the following review helpful
5.0 out of 5 stars Imparts benefits from much experience with wisdom & humor 29 Aug 2003
By "snoeyink" - Published on Amazon.com
Format:Paperback
This book is exactly what I was looking for to lead a seminar in bioinformatics at UNC Chapel Hill that brings together bio-chem-phys students with computer science students to try to raise the level of programming sophistication of the former, and raise the level of biochem/biophys sophistication of the latter. It collects examples of why and how to read code, pointing out lessons about the idioms and pitfalls that can help you write, maintain, or evolve code under your control. Full of good ideas, drawn from a lot of experience, and written with humor.
The only problem is that inexperienced programmers, who would benefit most from this book, are unlikely to pick up a book on how to read C programs unless someone tells them to. Experts will find that they have already learned most of these things from their experience, although they may still enjoy this book for confirming what they know. But I think that experts will also enjoy being able to loan this book to inexperienced programmers to transmit the wisdom distilled from experience.
13 of 16 people found the following review helpful
5.0 out of 5 stars Valuable resource of Information and good practices 21 Jan 2004
By Amazon Customer - Published on Amazon.com
Format:Paperback
A valuable resource for best practices, do's and don'ts, what works and why, what you should do in various situations of project, code, and architecture evaluation, and everything in between. In one phrase, this book depicts Software Engineering's best practices for the real world. No heavy-duty processes to follow, no reading of Software Engineering text books that are over a 1000+ pages. More importantly, everything in this book is REAL. References are given to open source projects where the author took the examples from, and the CD-Rom includes the complete code examples given in the text.
The author starts off by giving a background on the most popular programming languages used in the open-source community such as C/C++ and Java. Some scripting languages such as a PHP and Perl are also covered, but the main focus of the book is on C and C++. Data types, data structures and control flow are covered respectively and various best practiced of "what to-do" is given for each topic. These topics are somewhat basic, and if you are an advanced programmer, you can read thru these chapters in an hour or so. Even though these chapters are basic, they contain valuable to-do's and best practices that everyone of us will surly benefit from. They style of the book and its structure is nothing like I have seen before and it takes a couple of chapter to get used to it.
Chapter 4 is one of my favorite chapters in this book. It talks about C Data Structures. Towards the end of the chapter, the author talks about Graphs and Trees. These two rather complex topics (books have been written on these two topics) are covered so well that with about 20 pages, the reader can get a very good understanding of the topics at hand. Concrete examples from various open-source projects are used again to get the point across, and the source code that is on the CD-Rom is reusable with little effort.
The fun begins with chapter 5, Advanced Control Flow. Recursion, exception handling, parallel programming and non-local jumps are the main topics covered in this section. Again, the sample codes really help the reader to understand the topic better, and they also can be refereed to in your next project - something I found very beneficial. Another interesting thing about this chapter is the part that compares the different thread implementation in various languages and platforms - Java, Win32 and POSIX. Example from each implementation is given to show the reader the difference in practices and to get the point across more clearly.
If you have ever been bored to death by reading books on Software Engineering and Software Processes and just wanted to be able to have a very light and proven process to help you out with your next project, then Chapter 6 - Tackling Large Projects, is for you. The author starts the chapter by going over some of the design and implementation techniques used widely in large projects such as:
· The need for a software process
· Complex Architecture
· The need to support multiple platforms
· The use of OO techniques
· Operator overloading techniques when appropriate
· The need for Libraries, Components and Processes
· The need for custom languages and tools
· The use of pre-processing for portability and other reasons
Some or all of these methods are needed in large software projects, and author goes into detail in chapter 6 to cover how these tasks can be accomplished efficiently and proactively throughout the project life cycle. The author starts by going over Project Organization such as directory structure and source tree organization to the build process to revision control for future releases and end the chapter with a topic on testing of software applications.
The next two chapters, Coding Standards and Documentation are simply priceless. In about 40 or so pages, the author is able to cram over twenty years of best practices in coding standards and documentation techniques. I have never read a book that covered these two topics so well. If you are a project lead, you can simply take these two chapters and use them in your next project because you will not find anything better elsewhere.
The biggest and the most imperative chapter in this book is Chapter 9, Architecture. Various architectural patterns are covered. Each pattern includes a list of projects in the open-source community where it was applied and was proven successful. The author then goes into various Control Models that are used in the industry such as:
· Event Driven Systems
· System Manager
· State Transition
And examples of each of these Control Models along with code samples are given. Various packaging methods and schemes such as namespaces, modules, objects, generic programming, Abstract Data Types and libraries are also depicted in this chapter. Chapter 9 is the longest chapter in this book, but also the most informative one.
D. Spinellis did a great job putting this book together. This book is packed with examples, best practices and information that are useful to developers, project leads and managers. Now you can have all the experience of the open-source community, the people that developed Linux, Apache and other popular software applications, at the tip of your finger.
4 of 4 people found the following review helpful
4.0 out of 5 stars Works best if you have the matching skill sets of the material... 11 Aug 2006
By Thomas Duff - Published on Amazon.com
Format:Paperback
If you're a programmer, you are going to be reading the code that others write. It's as simple as that. But reading code is not like reading someone's novel or article. You have to figure out what the code is doing, what was the intent of the writer, how does the code fit with all the other pieces, etc. Often, all that needs to be done without a single comment, either. With that in mind, Diomidis Spinellis wrote the book Code Reading - The Open Source Perspective. There are some pretty good perspectives and techniques here that probably work best if you're familiar with C and Unix...

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...
Were these reviews helpful?   Let us know
Search Customer Reviews
Only search this product's reviews

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 

Search Customer Discussions
Search all Amazon discussions
   


Look for similar items by category