Looking at something from a different point of view can reveal a hidden side. With physical objects this hidden side can be literal, hence why technical drawings of three-dimensional objects are often made using a multi-view projection, such as a plan view and elevation views. With abstract concepts the hidden side is more figurative. In software architecture, for example, view models, such as 4+1 or ODP viewpoints, can be used to bring different concerns of a system into focus, such as user interaction, governance, behaviour, code structure, information model, physical distribution, infrastructure, etc.
It is important to test for the desired, essential behaviour of a unit of code, rather than for the incidental behaviour of its particular implementation. But this should not be taken or mistaken as an excuse for vague tests. Tests need to be both accurate and precise.
Something of a tried, tested, and testing classic, sorting routines offer an illustrative example — they are to computer science as fruit flies are to genetics. Implementing sorting algorithms is far from an everyday task for a programmer, commodified as they are in most language libraries, but sorting is such a familiar idea…
As with any other form of writing, there is a skill to writing good comments in code. And, as with any other form of writing, much of the skill is in knowing what not to write.
It has been said that the difference between theory and practice is greater in practice than it is in theory. This observation certainly applies to comments. In theory, the general idea of commenting code sounds like a worthwhile one: offer the reader detail, an explanation of what’s going on. What could be more helpful than being helpful? …
In jumping from calendars that are a distance apart and moving at different speeds, you need to change gears to get the two in sync. This can upset the regularity of our expectations:
I said that calendar years have one of two day counts: 365 and 366 days. In the Gregorian and Julian calendars this is true… but when jumping from one system to another, truth is more fluid.
In the default case you take the baseline of 365 days and add an optional leap year. In exceptional cases, such as changing from the Gregorian to the Julian calendar, you…
It’s 23rd April, World Book Day, as I write this.
Miguel de Cervantes and William Shakespeare both died on 23rd April 1616. They did not, however, did not die on the same day. There is no paradox, but there is an assumption: these dates of death do not come from the same calendar.
In 1616 Spain was following the Gregorian calendar, introduced by and named for Pope Gregory XIII in October 1582, and England was still following the Julian calendar, based on Julius Caesar’s calendar reforms in 46 BCE. …
Behind every story lies a story. This one begins one Saturday morning in Malmö. To be precise, Saturday 7th March at the single-day, single-track Beauty in Code conference. I’m speaking in the afternoon. Just before nine o’clock, however, I’m still upstairs in my hotel room, taking it easy.
Just then I receive a WhatsApp message: “Are you coming down?” It’s from Alistair Cockburn, who’s giving both the opening talk of the day, Getting back to the Heart of Agile, and the closing one.
“Yes, but not for a few minutes. Got caught in an email.”
“I’m going to ask you…
The motivation and desire for modularity is not new. In the proceedings of the 1968 NATO Software Engineering conference, the landmark conference that helped popularize the term software engineering and a vision of software components, E E David outlines an approach for the development of large systems:
Define a subset of the system which is small enough to be manageable, then build on that subsystem. This strategy requires that the system be designed in modules which can be realized, tested, and modified independently, apart from conventions for intermodule communication.
From the same conference, H R Gillette describes how modularity supports…
Happy New Year! At the time of writing, the Gregorian New Year lies in the rear-view mirror, and we have arrived at the Lunar New Year.
Around the world, people’s lived are governed and influenced by many calendars. While they differ in their structures, motivations and durations, they are all cyclic. In spite of this multiplicity, one system is used officially by all nations. …
I’m writing this on 1st January 2020 (2020–01–01). It’s a new year, but is it a new decade? Some people object to that claim, insisting that the previous decade does not end until 2020–12–31 and, therefore, the new decade does not begin until 2021. Are they right?
This blog post was inspired by one such discussion (with Marco Heimeshoff and J B Rainsberger), because — in addition to being fun! — it helped reveal some of the assumptions that surround calendars. I recently wrote that
Date–time handling is harder than people expect — even when they’re expecting it. It is…
If you ever want to walk to Hell, the journey will be easy on your feet. The whole road is very well paved, with good intentions as far as the eye can see. At least one of those paving stones is dedicated to Java’s checked exception model.
A checked exception is one that, if not handled within a method, must appear in the method’s
throws clause. Any class descended from
Throwable can be listed after
throws, but unhandled checked exceptions (not descended from either
Error) must appear. …
consultant · father · husband · itinerant · programmer · speaker · trainer · writer