Book review: A Philosophy of Software Design by John Ousterhout

Next for review is A Philosophy of Software Design by John Ousterhout. This a book about a big idea for software design. The big idea is that good software design is about managing complexity. In Ousterhout’s view complexity leads to a set of bad things: (1) change amplification – small changes in code lead to big effects, (2) cognitive load – complex software is difficult to understand, and (3) unknown unknowns – complex software can spring the unexpected on us.

Ousterhout covers this big idea in 20 short chapters with frequent reference to a projects that he has run with students repeatedly (including a GUI text editor and a HTTP server) – providing a testbed for reviewing many design choices. He also uses the RAMCloud project as an example, as well as features of Java and the UNIX operating system. This makes a refreshing change from artificial examples.

To decrease complexity requires developers to think strategically rather than tactically which goes against the flow of some development methodologies. Ousterhout suggests spending 10-20% of time on strategic thinking – this will pay off in the long term. He cites Facebook as a company who worked tactically and Google and VMWare as companies who worked more strategically.

At the core of reducing complexity is the idea of “deep modules”, that’s to say systems that have a relatively small interface (the width) which hides information about a potentially complex process (the depth). The Java garbage collector is the limiting case for this – having no user accessible interface. The aim of the deep modules is to hide implementation details (information) from users whilst presenting an interface that only takes what is required. This means deciding what matters to the user – and the best answer is as little as possible.

This goes somewhat against the ideas of the Agile development movement, as expressed in Clean Code by Robert C. Martin (which I read 10 years ago) – who was a big fan of very short functions. I noticed in my review Clean Code that I have some sympathy with Ousterhout’s view – small functions introduce a complexity overhead in function definitions.

Also on the theme of Agile development, Martin (in Clean Code) sees comments as a failing whilst Ousterhout is a fan of comments, covering them in four chapters. I recently worked on a project where the coding style was to rigorously exclude comments which I found unhelpful, that said I look at my code now and see orphaned comments – no longer accurate or relevant. The first of Ousterhout’s chapters on comments talks about four excuses to not provide comments, and his response to them:

  1. Good code is self-documenting – some things cannot be said in code (like motivations and quirks)
  2. I don’t have time to document – 10% of time on comments will pay off in future
  3. Comments get out of date and are misleading – see later chapter
  4. The comments I have seen are useless – do better!

The later chapters focus on the considered use of comments – thinking about where and what to comment rather than sprinkling comments around at a whim. The use of auto-documentation systems (like Sphinx for Python) is a large part of realising this since they force you to follow standard formats for comments – typically after the first line of a function definition. Comments on implementation details should be found through the body of a function (and definitely not in source control commit messages). He also introduces the idea of a central file for recording design decisions that don’t fit naturally into the code. I include the chapter on “Choosing names” under “comments” – Ousterhout observes that if you are struggling to find a good name for something there is a good chance that what you are trying to name is complex and needs simplification.

Certain types of code, Ousterhout cites event-driven programming, are not amenable to producing easy to understand code. He also dedicates a chapter to handling errors – arguing that errors should be defined out of existence (for example deleting a file that doesn’t exist shouldn’t cause an error, because the definition of such a function should be “make sure a file does not exist” rather than “delete a file”). Any remaining exceptions should be handled in one place, as far as possible.

There is a chapter on modern software development ideas and where they fit, or don’t, with the central theme. Object-orientation he sees as good in general, with information hidden inside classes but warns against over use of inheritance which leads to complexity (just where is this method defined?). He also comments that although design patterns are generally good their over-application is bad. He is in favour of unit tests but not test-driven development. This seems to be related to his central issue around Agile development – it encourages tactical coding in an effort to produce features rapidly (per sprint). He believes Agile can work if the “features” developed in sprints are replaced with “abstractions”. He doesn’t like Java’s getters and setters, nor its complex serialisation system which requires you to setup up buffering separately from opening a file as a stream – I remember finding this puzzling.

I enjoyed this book – it provides some support for continuing to do things I currently do although they are a little against the flow of Agile development and food for thought in improving further.

Book review: Her Space, Her Time by Shohini Ghose

My next review is of Her Space, Her Time by Shohini Ghose. I picked this book up as a result of a review in New Scientist. It is in the spirit of Broad Band which covered the contributions of women to computing over the years – contributions which have historically been ignored. Her Space, Her Time does the same for women in physics, generally on the astrophysics and cosmology side of the subject.

The book is divided into seven chapters each covering an area of physics and a group of women who worked in those areas. The chapters cover star cataloguing (and rather more), the big bang, the space programme, radioactivity, nuclear fission, particle physics and dark matter/ beta decay. This results in a coverage which is approximately chronological.

There are some recurring themes in the book: women not allowed entry to universities for undergraduate and graduate studies, women not allowed employment in university departments and facilities (often the pretext is the lack of toilets for women), women not allowed employment at the same institution as their spouse (this seemed common in the US and its effect on the recruitment and promotion of women was noted as far back as 1966), being ignored by the Nobel Prize committee and (sometimes) their male collaborators. These women were frequently the only women in the room. Fleeing Nazi Germany (and Austria) is a theme too but that applies equally to men.

On a more positive note their work was often recognised and rewarded during their lifetimes by their scientific communities. In at least the case of Ernest Rutherford and Ernest Lawrence they had the support of senior scientists throughout their lives.

The Harvard Observatory features heavily in the first couple of chapters. Women originally became involved as “computers” analysing the stars in the photographic plates. They included Williamina Fleming, Annie Jump Cannon, Antonia Maury and Cecilia Payne-Gaposchkin with Anna Draper providing funding to the observatory via a bequest in the late 19th century. In they first instance they were analysing stars for brightness and then later for spectral features. A group of women were responsible for compiling the “Harvard” stellar classification scheme which classifies stars by temperature using the letters O, B, A, F, G, K, M (typically remembered by a sexist mnemonic). One of the women, Henrietta Swan Leavitt, discovered the relationship between brightness and period for stars which is central to measuring intergalactic (and shorter distances) and was key to understanding the scale of the galaxy and the universe. Over a very long period Harvard Observatory allowed women to be employed as astronomers, and finally become professors in astronomy. The transitions usually being the result of a change in observatory or university management.

The third chapter is a bit of an oddity, looking at women’s contributions to the space programme on the project management and rocketry side of things rather than physics as such.

The final four chapters are then an extended collection on nuclear physics starting with Marie Skłodowska-Curie, and the less well known Harriet Brooks who worked on the new subject of radioactivity in the late 19th century. Brooks worked with Rutherford, publishing in 1904 in Nature on their discovery of radon. Rutherford and Frederick Soddy would earn the Nobel Prize for the transmutation of elements whilst Brooks was left out. Rutherford and Brooks clearly had a long personal relationship, ending in 1933 on her death at the age of 56. Brooks had left physics research in 1907 when she married Frank Pitcher.

Chapter 5 largely concerns Lise Meitner who was involved in the discovery of nuclear fission with Otto Hahn with whom she worked closely for many years. Hahn received the Nobel Prize for their work on nuclear fission, whilst she did not – this has been seen as one of the more egregious omissions of the Nobel Prize Committee – Meitner was nominated for a Nobel Prize 48 times and was widely recognised as an expert in her field. Her position was made more difficult because she was Jewish, worked in Austria and with Hahn who despite protestations was a Nazi sympathiser at the very least.

Chapter 6 concerns cosmic rays and the photographic detection thereof. It starts with Bibha Chowdhuri who is from Ghose’s home city of Kolkata and was later to discover cosmic ray muons using this method. The focus of the chapter though is Marietta Blau and her student Hertha Wambacher who developed the method of photographic detection of cosmic rays. The Meitner/Hahn story is reprised here with Jewish Blau forced to leave Vienna in 1938 with her student Wambacher, a Nazi sympathiser, remaining to take credit. Elisa Frota-Pessoa, a Brazilian physicist, is mentioned somewhat incidentally towards the end of the chapter with Ghose stumbling on one of her (very prescient) publications whilst researching other work.

The book finishes with the slightly odd pairing of Wu Chien Shiung who was instrumental in the discovery of parity violation which won her colleagues Tsung-Dao Lee and Chen-Ning Yang the 1957 Nobel Prize in Physics (they specifically mentioned her in their acceptance speech) and Vera Rubin who is credited with discovering dark matter by measuring the rotation curves of galaxies and observing that they flatten at large radii – an indicator of the presence of extra, unseen matter.

Reading back through my notes, women were at the heart of modern physics through the 20th century, often those women were the only ones in the room – it is clear they were exceedingly capable. The men around them collected a dozen Nobel Prizes whilst the only woman from this book to win the Nobel Prize for Physics was Marie Skłodowska-Curie. Maria Goeppert Mayer shared the Nobel Prize for Physics in 1963 she is the only other woman to win in the 20th century. She is not included in this book, perhaps because her Nobel Prize meant she was already well known.

In the past I thought the Nobel Prize committee were simply a bit careless in failing to award women but reading this book it seems they were rather purposeful – the physics community knew these women, and the significance of what they had done, and many were nominated for a Nobel Prize, often repeatedly.

As a result of this book I am now interested in a parallel volume of Indian scientists in the West!

Review of the year: 2023

Selfie of the three of us on the doorstep for Thomas' first day at school
The three of us

This year has been rather unusual as a result of redundancy, and long COVID.

I caught COVID in February 2022 and my fitness has been in steady decline since then – I used to be able to run 3x10km per week but through 2022 I struggled to work my way back to that level and in fact each time I made progress I was knocked back to a lower level until by September this year I stopped running. I have also missed out on holidays and family gatherings – knowing that an half an hour or so of mild exertion would leave me exhausted. In the spring of this year I approached my GP, and after a long series of tests which showed I was in otherwise excellent health I ended up in my local long COVID clinic in October.

The long COVID clinic has been really helpful – after an initial evaluation appointment (an hour long with two people!) I now have a monthly meeting with an occupational therapist whose main advice is not to do too much and rest. I’m currently stable but not doing much, looking forward to working my way back up very cautiously.

This summer, at the age of 53, for the first time in my life, I was made redundant. This was a rather stressful process, mitigated slightly by the fact that at the first hint of redundancy being on the cards (invitation to a meeting with line manager and a representative of HR) I made my “can I retire?” spreadsheet and that looked like a possibility! I am not retiring though. I wrote a “Leaving Address” blog post. After spending the summer lounging around doing not much except a little DIY, I then spent the Autumn doing little on the advice of the long COVID clinic.

Photograph of a stylised bronze-like women (called Myrtle) - she is a planter. Lying on a bench following repair
A little DIY – Myrtle fixed in the Kintsugi style – the brown part is a replacement

Then I became employed by mistake*! My old boss from ScraperWiki got in touch asking if I was available because UNOCHA were looking for someone to do maternity cover. I worked on the establishment of the Humanitarian Data Exchange for UNOCHA nearly 10 years ago. The day after my first contact I spoke to someone I’d worked with 10 years ago, submitted my CV and filled in a form. I had a contract inside a week! I’m really enjoying the work. The end of year townhall meeting was a bit of an eye-opener – it included personal testimonies from people working in Türkiye (where there was an earthquake earlier this year), Yemen (war zone) and Gaza (also war zone).

I blogged about 18 books this year, including biographies of Richard Trevithick, John von Neumann, Margaret Cavendish, and Grace Hopper. If nothing else they highlighted just how exceptional and unusual people who warrant biographies are. The Grace Hopper biography was prompted by Broad Band by Claire L. Evans a book about women working in computing over the years since Ada Lovelace in the first half of the 19th century.

There have been a few books that fit under the diversity theme, in addition to Broad Band, On Savage Shores by Caroline Dodds Pennock – about native Americans in Europe from the 15th century, Femina by Janina Ramirez – about women in the medieval period and The First Astronomers by Duane Hamacher . The First Astronomers is about aboriginal astronomers from various parts of the world (although mainly Australia) – they are very astute observers, aware of phenomena only recognised in the West in the later 19th century. I also gained a better appreciation for oral traditions from this book, stories are not meant to be taken literally – they are mnemonics to pass on vast bodies of knowledge as accurately as possible. I think these books have had the biggest impact on how I think.

There was a thread of books on data visualisation too – starting with Storytelling with data by Cole Nussbaumer Knaflic continuing with Data Points by Nathan Yau, Resonate by Nancy Duarte and finishing with Storytelling with you by Cole Nussbaumer Knaflic. In other technical books I also read Masterminds of Programming by Federico Biancuzzi and Shane Warden – about the inventors of a number of programming languages, and The Mythical Man-month by Frederick Brooks Jr. The Mythical Man-month is a classic in software project management, written based on experiences in the late sixties it has the air of fifties era sci-fi, fantastically insightful in places but deeply anachronistic in others.

With time on my hands I also started a series of technical posts of my own, on the ecosystems for different programming environments – starting with Python and Typescript – this turned out to be quite revealing – Python is my “first” programming language at the moment but researching the Typescript ecosystem clarified my understanding of Python.

I read a couple of historical overviews, The Earth Transformed by Peter Frankopan, about the impact of the environment on human history and vice verse, and How the world thinks by Julian Baggini – this is a comparative history of philosophy. The Wood Age by Roland Ennos and Foreign Bodies: Pandemics, Vaccines and the Health of Nations by Simon Schama are difficult to classify. I must admit I struggled with Foreign Bodies, it featured incredibly long chapters, and the longest sentence I recall reading in English.

My son started high school, which went very well. There is a lot more preparation than there was when I was growing up, transition days, a couple of summer school days and a WhatsApp group! Mrs H is now Dr H – she graduated from her EdD in October.

Photograph of an 11 year old boy in school uniform and a woman in a graduation gown and hat with a starry dress. Both are smiling
Sharon, dressed for graduation for her Ed.D with Thomas

Personally, I am hoping for a better 2024 with some recovery from long COVID and perhaps the continuation of the work I am doing with UNOCHA.

  • Withnail and I reference :-)

Book Review: Grace Hopper – Admiral of the Cyber Sea by Kathleen Broome Williams

After reading Broad Band by Claire L. Evans, about women in computing, I realised Grace Hopper was important, so I thought I’d hunt out a biography. I found Grace Hopper: Admiral of the Cyber Sea by Kathleen Broome Williams. Unusually I bought it second hand – my copy came from the Richard Stockton College of New Jersey Library Pomona, and has an austere, maroon cover.

Grace Hopper was born in New York City in 1906, she died in 1992. An undergraduate in mathematics she started a career in teaching at Vassar College but joined the Navy after the US joined the Second World War. She was posted to work on the Mark I computer at Harvard. She subsequently wrote the first software compiler, and was instrumental in the creation of the COBOL programming language. After “retiring” she then had a long career in the US Navy working on standardising their computing systems. After finally retiring from the Navy she worked for DEC for a few years until her death at the age of 86. She finished her career a rear admiral in the US Navy and has a battleship named for her (the USS Hopper) amongst numerous other rewards.

Grace Hopper gives some feel as to how it was to grow up in a relatively wealthy New York City family. The Hopper family had a holiday home in Wolfeboro, New Hampshire which, when she was small, was a day and a half travel to reach from New York City. She was brought up to be self-sufficient and trained in mathematics. Her father worked in insurance and was a double amputee – he wanted to make sure his children could fend for themselves should he die although he survived to a fair age.

Hopper studied mathematics first at Vasser College before going to Yale for a PhD in mathematics. She married Vincent Hopper in 1930, they bought a summer home of their own in Wolfeboro for $450 – part of a wedding gift. They were divorced in 1941 although it was not something she talked about, despite giving numerous interviews later in her live. Grace Hopper does not indicate the grounds for her divorce. After gaining her degree she became a lecturer in Vasser College where she was an excellent and committed teacher.

When America joined the war she was keen to serve in the US Navy which she achieved following some struggle. Fundamentally they were not keen to employ women, furthermore she was older than the Navy typically recruited, technically underweight and in a reserved occupation (as a lecturer in mathematics). Eventually she joined in 1942, and finally entered service in 1944, after training. She was proud to work in the Navy throughout her life and even whilst employed in industry she continued in the reserve service. In her Navy service she found a link with the dignitaries, including royalty, she met in later life.

Her naval placement was with the Mark I computer at Harvard, invented by Howard Aiken and built by IBM. It was the first programmable electromechanical computer in the world. Based on the slightly older relay technology rather than valves found in successors it was used principally for ballistic calculations as well as calculations of various function tables. Aiken was pretty tough to work with but Hopper clearly knew how to handle him and held him in high regard. She worked on many of the Mark I’s smaller programming jobs as well as doing more than her share of documentation and report writing.

One issue with the Mark I was that it was programmed with paper tape, the programs and data are stored as a pattern of holes 3-4mm across punched out the tape. There was a lot of paper around, as well as the disks of paper punched out from the tape. Sometimes one of the punched out disks was re-united with a hole causing an error, as Hopper pointed out “a hole getting back into a hole”!

After the war it was clear she would not be able to continue at Harvard, so she let to work on the UNIVAC at the Eckert–Mauchly Computer Corporation, later bought by the Rand Corporation and then IBM. Through Hopper’s life we see the birth and maturing of the new computing industry.

Hopper realised there was a need for standardisation in programming languages. There were an increasing number of different types of computer around, and the maintenance and programming of such computers was a bigger job than had initially been realised. Standardisation reduces this problem because a program written for one computer can be run on another. This is how COBOL was born, the Navy sponsored the Committee on Data Systems Languages (CODASYL) which created the COBOL programming language which was derived from Hopper’s FLOW-MATIC language developed for the UNIVAC.

As a scientist and software developer for 30 years I was scarcely aware of COBOL, yet it comprised approximately 80% of running code in the late nineties, according to Gartner. I imagine that figure has not dropped greatly. There is clearly a huge body of COBOL “dark matter” that software developers don’t talk about. The reason for COBOL’s obscurity seems to be the disdain of the academic computer science community, FORTRAN – born at the same time – suffers a similar disdain.

During her time working on UNIVAC Hopper maintained her Navy connection through a reserve position, and in 1966 – at the age of 60 – she retired from the reserve to work full time for the Navy at the Pentagon. She continued to work in the Navy until 1986 when she left to join DEC, at the age of 80!

In this book Grace Hopper comes out as an exceptional character. Her great skills were rooted in teaching, the drive to build a compiler was partly making her own life easier but also democratising the process of programming. She also saw the importance of raising a generation of programmers. She was very personable but seemed to have virtually no personal life. She drank moderately and smoked heavily for most of her life, and clearly had a bit of a hording problem towards the end. She was a life-long Republican and saw little value in the women’s rights movement – her own enormous success giving her the impression that there was no inequality to address.

Throughout her life, well into the period others might consider retiring, she was was engaged in a full schedule of public speaking. She gained many rewards, and a great deal of recognition in her lifetime.

I really enjoyed this book, the only place my interest lessened slightly was in the chapter describing administrative reorganisations of the US Navy. I am in awe of the achievements of Grace Hopper.

Book review: How the world thinks by Julian Baggini

Whilst economising during a period without work I thought I would turn to other books in the house to read and review. This is how I came to How the World Thinks: A Global History of Philosophy by Julian Baggini. This is not to say I am uninterested in philosophy but, as a scientist in the Western tradition, philosophy was a substrate on which I worked without thinking.

How the World Thinks aims to provide an outline of the major schools of philosophy around the world, Baggini alludes to the fact that in the Western world university philosophy departments are more accurately described as “Western philosophy” departments. Comparative philosophy, apparently, is not really a thing. Baggini also talks about how “academic” philosophy impacts the culture in which it sits – a process called sedimentation. Baggini cites the 5rd-3th centuries BCE as when the major philosophical traditions were born (know as the Axial Age), when understanding of the world started moving from myth to some sort of reason.

How the World Thinks is divided into four parts and an additional concluding part; these cover the nature of philosophy in different traditions, the nature of the world, who we are and how philosophy impacts the way we live. The text typically covers Far Eastern traditions (China and Japan), India, Islamic and Western traditions with some references to African philosophy. Rather strangely he mentions Russian philosophy in the final part, only to say really he hasn’t mentioned Russian philosophy!

Western philosophy is built around “reason” and nowadays is largely separate from theology, there are empiricist and rationalist schools within this. Empiricists believing on observing the world and building models based on observation, whilst rationalist believe the world can be understood with pure thought. East Asian philosophy is more concerned with a “way” of living in the world which is difficult if not impossible to explain in words. Indian philosophy lies between these two. Interestingly yoga is part of a philosophical tradition which sees it as a way of better seeing how the world really is.

The next part of the book concerns the processes that govern the world: time, karma, emptiness, naturalism, unity, and reductionism. Karma is a particularly Indian concept, and is linked by Baggini to the caste system which DNA evidence dates back to the 6th century AD. East Asian philosophy is more concerned with emptiness / nothingness then Western philosophy – it struck me reading The First Astronomers that Australian Aboriginal constellations include the absence of stars into their constellations. Naturalism, a regard for nature which links the natural world to the human, is stronger in East Asian philosophies – Chinese art incorporated natural scenes long before Western art. Islamic philosophy is strong on unity, whilst Western philosophy likes reductionism.

Part 3 concerns the self, contrasting the East Asian view of the self which is defined in relationship to others, similarly in Africa, with the indivisible, individualistic self of the West. There is even the idea that the self does not exist, as such. Baggini refers to the indivisible self as “atomistic” which harks back to the ancient Greek definition but for a modern scientist this is a bit confusing because an atom is a very different thing. Indian philosophy thinks in terms of a self that is reborn but need not hold any recollection of previous selves. Perhaps not made explicit in this part but one gets the feeling that other philosophies have a strong sense of being concerned with individual self-improvement, by acting in the right way, leading the right life one improves through each rebirth.

The final part of the book concerns how the world lives, how the philosophy discussed in earlier chapters is reflected in culture. This starts with a consideration of the idea of “harmony” in China, this can have elements of hierarchy and misogyny. Although Baggini highlights that it is understood that hierarchy is not bad in all cases, or even most. There is a chapter on “virtue” which as much as anything highlights that the meanings of words when translated can shift. We might think about the importance of “ritual” in Far Eastern cultures but equally we could call it “cultural grammar” which has different connotations in English .

I found How the World Thinks straightforward enough to read, the chapters are a convenient size and the style is readable. It also thought provoking, in that it challenges the deepest assumptions about the way I lead my intellectual life – in some ways it parallels The First Astronomers by Duane Hamacher in this respect.