I use these notes to track thoughts I had, and things I found interesting, while reading Object-Oriented Design and Data Structures

The notes are still in progress as I have not yet finished reading the book

1. Introduction

  • The book starts off with the great observation: “One of the joys of working with computers is that it is relatively easy to create new things…The constraints of the real world weigh much less heavily on software developers than on engineers in other disciplines.” This is often expressed in technology social media as “you can just do things

2. Values, Types, and Variables

  • There are different definitions of a strongly-typed language, but the one used in this book is “run-time type errors are not possible.” Wikipedia points to an article by Luca Cardelli with a similar definition: “the absence of unchecked run-time type errors
  • The book observes that Java, unlike Python, is whitespace-insensitive, but, in practice, everyone uses it in a whitespace-sensitive manner, with line breaks and indenting, for readability
  • The book states “Local variables are in scope from the point of declaration until the end of the block in which they are declared” This is different from languages like Python, which have function, not block, scope. In Javascript, variables defined with var had function scope, but variables defined with the modern let and const are more similar to Java.
  • I believe the only variable shadowing in Java that is disallowed is local variables over other local variables. Everything else is fair game and, as the book points out, the cause of various errors. As far as I know, there’s no option to get the Java compiler to be stricter about shadowing and print warnings

4. Java Execution Model: Arrays, Strings, Autoboxing