How to Think Like a Computer Scientist C Version

OER Reviewed: How to Think Like a Computer Scientist C Version (Green Tea Press)

Reviewer: James Bailey (No current affiliation)

Rating

Each criterion asks the reviewer to rate it on a scale of 1 to 5 (1 = very poor and 5 = excellent).

Comprehensiveness – Rating: 5

The OER covers all areas and ideas of the subject appropriately and provides an effective index and/or glossary.

This book gives a “lean and lively” introduction to computer programming. It is intended to give a taste of what programming is about rather than to make the reader into an expert programmer. There is a careful selection of topics so it will be manageable for novice programmers and also form a good basis for further learning.

The author covers only incremental development of software (starting with a very simple, working program and then adding a little at a time so it always works) which is probably the easiest way for a novice to start. Every chapter ends with a Glossary which immediately precedes a set of Exercises. There is an Index at the end of the book.

A note about the Glossaries: the author says “Computer scientists have the annoying habit of using common English words to mean something different from their common English meaning.” I noticed that the glossaries tend to leave out words whose technical meaning is close to the English meaning (probably to keep the glossaries from becoming cumbersome), but here were a couple terms which I felt should have been included:

  • typecast in Chapter 3;
  • call-by-reference (evaluation) in Chapter 7.;

Content Accuracy – Rating: 5

Content, including diagrams and other supplementary material, is accurate, error-free, and unbiased.

The content is based on ANSI C and is accurate. I found an error in one diagram: on page 109 the diagram is not consistent with the body of the text (the values of point are inconsistent).

Relevance/Longevity – Rating: 5

Content is up-to-date, but not in a way that will quickly make the OER obsolete within a short period of time.  The OER is written and/or arranged in such a way that necessary updates will be relatively easy and straightforward to implement.

C is extremely stable. This book is based on ANSI C (possibly the C98 standard of the language) and will remain current so long as ANSI C is considered to be the standard, which is to say for the foreseeable future.

Clarity – Rating: 5

The OER is written in lucid, accessible prose, and provides adequate context for any jargon/technical terminology used.

The author writes very clearly, concisely, and in simple English. Technical terms are explained when they are introduced and also in the Glossary at the end of each chapter. New concepts are introduced as they are needed and are motivated by previous content.

The author often helps students understand the learning objectives of the Exercises with helpful hints such as: “The point of this exercise is to use the output function printf to display values with different types, and to practice developing programs gradually by adding a few statements at a time” or “The point of this exercise is to use some of the arithmetic operations, and to start thinking about compound entities like the time of day that are represented with multiple values. Also, you might run into problems computing percentages with ints, which is the motivation for floating point numbers in the next chapter.”

Consistency – Rating: 5

The OER is internally consistent in terms of terminology and framework.

I found that the flow of the book was predictable—I don’t remember being surprised. Font usage is consistent and conveys meaning because it follows usual typesetting conventions: Roman (serif) is used for regular text; Roman boldface is used for chapter titles, section headings, and for terms which are being defined; italic is used to reference other books; typewriter is used for program code and URLs; etc.

Roughly speaking, this text is organised around header files so similar tasks which might be used in a program are grouped together. Sections start with easily understood statements and proceed to more abstruse ones.

Modularity – Rating: 5

The OER is easily and readily divisible into smaller reading sections that can be assigned at different points within the course (i.e., enormous blocks of text without subheadings should be avoided).  The OER should not be overly self-referential, and should be easily reorganized, and realigned with various subunits of a course without presenting much disruption to the reader.

Each chapter is based on previous chapters and, given the prerequisite material, can stand by itself.

The Exercises are well thought out. They challenge students to apply their knowledge and and push them in new directions.

The well-designed sections in this text are well thought out and are less than 5 pages long. There is a nice flow through the book—topics arise naturally from previous topics. Topics tend to build on previous topics (there is a hierarchical structure of the concepts presented) and because the text might be described as “lean” there is not much that could be left out without affecting later sections.

If someone wanted to add a topic, it would probably be possible to find a section in the text which it could be put after.

If you want to edit, reorganise, or add to this book, then the LaTeX source code is available from https://github.com/tscheffl/ThinkC.

Organization/Structure/Flow – Rating: 5

The topics in the OER are presented in a logical, clear fashion.

This book has a nice flow—topics arise naturally from what was previously presented. From time to time an Exercise will present a problem which motivates the topic in the next section. Learning occurs through problem solving: there is a problem which we want to solve by computing; elementary methods are used to find an easy but lengthy solution; more advanced methods are presented; they are used to find a more concise solution; and the new, more powerful methods are used to solve more difficult problems.

Interface – Rating: 5

The OER is free of significant interface issues, including navigation problems, distortion of images/charts, and any other display features that may distract or confuse the reader.

I was not aware of any interface problems. There are clickable links in the Table of Contents and Index, and the few that I tried worked as I expected. There are a small number of references between Exercises with clickable links to make it easier to find the Exercise which is being referred to. The images were clear, simply drawn, and without distortion.

Grammatical/Spelling Errors – Rating: 4

The OER contains no grammatical or spelling errors.

Here are a few examples of typographical (English) errors which will be spotted by a fluent English speaker, immediately understood, and corrected:

  • page 77: “separated by comma” should be “separated by commas.”
  • page 92: “The compiler compute the necessary array size…” should be “The compiler computes the necessary array size…”
  • page 111: “persons age” should be “person’s age.”

Programming typographical errors which will be caught when they are copied into a program because they produce compiler errors:

  • page 52: printf ("%f\n" dist); should be printf("%f\n", dist); (comma missing).
  • page 52: printf ("dy is %f\n", dy; should read printf ("dy is %f\n", dy); (close parenthesis missing).
  • page 66: printf("%.0f\t%f\n", x ,log(x)); the format string is used without explanation. It should probably be printf("%.1f\t%f\n", x ,log(x)); In any event, the construction printf("%.1f… needs an explanation.
  • page 66: “Escape sequences can be included anywhere in a string, although in these examples the sequence is the whole string.” It is not clear what the author intended by this.
  • page 75: Exercise 6.4 One way to evaluate e−x2 is to use the infinite series expansion

[latex]e^{-x^2}=1-2x+\dfrac{3x^2}{2!}-\dfrac{4x^3}{3!}+\dfrac{5x^4}{4!}\cdots[/latex]

This is not correct. It should be

[latex]e^{-x^2}=1-x^2+\dfrac{x^4}{2!}-\dfrac{x^6}{3!}+\dfrac{x^8}{4!}+\cdots[/latex]

or

[latex](1-x)e^{-x}=1-2x+\dfrac{3x^2}{2!}-\dfrac{4x^3}{3!}+\dfrac{5x^4}{4!}\cdots[/latex]

Students who write the program in this exercise will test it with several values and use a calculator to check their results. There is no way for them to track down where the error is!

  • page 110 “(without the s)” should be “(without the *s)

Diversity and Inclusion – Rating: 5

The OER reflects diversity and inclusion regarding culture, gender, ethnicity, national origin, age, disability, sexual orientation, education, religion. It does not include insensitive or offensive language in these areas.

This textbook is abstract and there are no cultural references. It assumes that the reader is fluent in English and has high school level algebra and knowledge of the most common functions i.e. the exponential, logarithm, and trigonometric functions (Exercise 6.4 on page 75 is an exception). I was not aware of any gender specific references or anything which might single out any person or group. I am aware that “primary” and “secondary” are being substituted for “master” and “slave” in server software, but I couldn’t see any problem similar to this one.

Recommendation

  1. Do you recommend this resource for the specific course taught in the first-year engineering common curriculum (in place of a commercially available resource)?
    Yes.
  2. If yes, please briefly summarize the reasons for recommending this resource

    This text uses C to provide a gentle introduction to programming. The concepts are presented in a generic way so they can be built upon or transferred to similar languages such as C++, C#, Java, Perl, PHP, Python, etc.

  3. What gaps in content have you identified?

    This OER provides a nice introduction to programming in C and by the end of it a student should be able to write simple programs which perform a variety of tasks and display the results on the terminal. However, it is aimed at students in general, not specifically STEMM (Science, Technology, Engineering, Mathematics, and Medicine) students. It does not stress calculations, so an engineering student would probably need a single page reference card listing the mathematics functions which are available when the header file <math.h> is loaded. The format string of printf needs further explanation. For example, “precision” and “width” should be discussed. An introduction to reading and writing to disc (for example fscanf and fprintf found in <stdio.h>) is needed so results can be stored, retrieved later, and inserted into reports.

    I would probably make students aware of Wikipedia: C standard library

License

Icon for the Creative Commons Attribution 4.0 International License

Common First Year Curriculum for Engineering: OER Reviews Copyright © 2021 by BCcampus is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book