The reading of code is likely to be one of the most common activities of a computing professional, yet it is seldom taught as a subject or formally used as a method for learning how to design and program. Aspiring writers are always told to read as much as they can if they want to become better writers. By code, of course, I mean the program source code, the fundamental recipe for any piece of software. You get assignment after assignment — persuasive essays, memos, poetry, research papers or prose. Now imagine that you have to do every one of these assignments from scratch, without any examples.
|Published (Last):||21 December 2016|
|PDF File Size:||1.1 Mb|
|ePub File Size:||5.92 Mb|
|Price:||Free* [*Free Regsitration Required]|
The reading of code is likely to be one of the most common activities of a computing professional, yet it is seldom taught as a subject or formally used as a method for learning how to design and program. Aspiring writers are always told to read as much as they can if they want to become better writers.
By code, of course, I mean the program source code, the fundamental recipe for any piece of software. You get assignment after assignment — persuasive essays, memos, poetry, research papers or prose.
Now imagine that you have to do every one of these assignments from scratch, without any examples. You have to work everything out yourself. This is the traditional method of teaching programming. I know because I used to teach programming classes. Code Reading is both refreshing and an eye-opener. Not only does Spinellis present a solid case for the habit of reading program source code, he also fills his book with code examples, complete with commentary. Though the examples are mainly from Java and C, the lessons learned can be applied to any programming language.
Just to be clear, the code presented is not from the toy examples found in programming textbooks. This is material from real, working software projects. The book covers major programming topics and even includes analysis of a complete, working program. Spinellis gives tips and techniques for the novice code reader to aid them in developing their skills. From my own experience, reading code can be very educational, even entertaining. Every programmer tries to put their own personal stamp on their work and part of the fun is seeing the human mind behind the algorithms.
For example, I was teaching game software development and wanted to get my students some practice in reading code. There was one particular feature in which I was interested. During play, you can set your tank to AutoPilot mode and let it play for you. This makes a nice change from having to pause your game whenever you have to get up and take care of business.
We grovelled through the source code files for a bit and I finally found the sections having to do with AutoPilot. As I read them, I spotted some code that looked very intriguing but was never actually called by any other part of the program. It looked like someone was trying to build a heuristic system for the AutoPilot mode. In short, it was meant to have the program build a solution starting with the goal and working its way backwards. It was very clever and had a lot of potential.
The fact that the code was just left there, unfinished, was fascinating. When I saw that code, I put myself in the mind of that programmer. But here was someone like me, trying to solve a problem in an interesting way and failing that, leaving a note for the explorers to come after in hopes that they would ultimately succeed where he did not. Spinellis, Diomidis. Code reading: the open source perspective.
Code Reading: The Open Source Perspective
Sommaire This book is a unique and essential reference that focuses upon the reading and comprehension of existing software code. While code reading is an important task faced by the vast majority of students, it has been virtually ignored as a discipline by existing references. The book fills this need with a practical presentation of all important code concepts, form, structure, and syntax that a student is likely to encounter. The concepts are supported by examples taken from real-world open source software projects. The focus upon reading code rather than developing and implementing programs from scratch provides for a vastly increased breadth of coverage.
Code Reading : The Open Source Perspective
Page How can you understand and simplify an inscrutable piece of code? Page 39 Where do you start when disentangling a complicated build process? Page How do you comprehend code that appears to be doing five things in parallel? Page 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.
Code Reading: Open Source Perspective
CODE READING DIOMIDIS SPINELLIS PDF