Books on programming languages

Nishank T
3 min readOct 5, 2017

--

Although I do not claim to have read many programming language books or know many programming languages, most books I have read followed a pattern. Majority of programming language books expound on one feature per chapter, cover everything about it and then move onto next feature in next chapter. Usually, the chapter keep increasing the complexity, with some books taking approach of keep-building-up and eventually end with a big example covering most of the language specific features.

I assume that above flow works best for majority of users. However, I find few things missing in this format. The next chapter usually has some disconnect w.r.t. concepts from previous, other than occasionally using terms introduced previously. Many times, a new feature is introduced as it was written in spec — just define it in technical terms and then show usage of it, with very little detail on reasoning behind it. Also, even though book might claim that it caters to programmers of different experience, usually it is difficult to choose and pick and make sense of book.

I feel following format could work best for programming language books. At least it does for me and so may be for few more people. The book should be categorized into three sections as follows —

  • Introduction to usual features and syntax, such as variable initialization, loop, functions, comparisons, modules, etc. All programming languages have these mandatory things, they are very similar in syntax and very easy to understand too. The very basic and primitive type of usage should be covered here, in case the language supports multiple format. If the reader is new to programming, this section ensures that reader gets time to grasp basic concept common to all programming languages. If reader has some programming background, they can quickly map syntactical format with languages they know and move on.
  • Introduction to new features of the language but more importantly reasoning for the feature. Ideally, the reasoning should be not just in words but through examples of what was lacking and how this feature fills the gap. For example, how yield works in Python and why was there a need for it. Or, why classes need a constructor in C++ and not just how to use them. Or, how Go coroutines are used and how they fill a gap, etc. This section is for intermediate programmers. Since, it is introducing concepts which might be unique to this language, it helps if proper justification is given as to why was there a need for it?
  • Finally, idiomatic aspect of the language. That is, more explanation and examples of anything from above two sections which is unique to this language in syntax or usage. For example, we went through a standard usage of for loops in first section but then, say, Python programmer can use for loop in variety of ways which can be showcased here. Or, how C programmer should approach a problem and potential code flow when writing in C++, etc.

Now with above flow, depending on reader’s prior experience with programming, she can comfortably skip first or second section to get most of the book. Even for experienced programmer, they don’t have to either deal with very basic concepts while skipping material here and there or try reading an advanced book which leaves holes in understanding.

I thought by spelling it out here, may be an author might consider similar format in her next book, or may be commenters can point out books which already do this or even suggest a better format.

--

--