Teaching SE: code as design

Software engineering lecturers have some misconceptions to grapple with — students’ certainly, but also our own.

One is this: we have tried to carve out an unambiguous1 distinction between software design and software implementation. In a previous post, I discussed a 2nd-year unit that historically focused on the Unified Modelling Language (UML). This unit purported to teach software design, to the exclusion of the “implementation” of that design. The unit content consisted almost entirely of diagrammatic notations (parts of UML) that, we assumed when they were first introduced, would stand on their own as the language of software design. The unit mentioned almost nothing about code, because we considered code to be a low-level implementation detail already covered in other units.

“UML is how you will write software”, some of us thought (to varying extents). “What comes after is just a labourer’s job.”

We2 wanted to believe this, probably because it seemed to imply that SE was maturing, that it was starting to develop efficiencies that would make current practice look like dark-age superstition. The notion of having separate “design” and “implementation” phases has been taken from older engineering disciplines (to some extent), in which a physical object is first designed, then constructed. That strict progression seems obvious. Design is the intellectual effort — the problem solving — while construction is physical creation of what you’ve designed.

Our UML fixation also owes something to the fact that diagrams play such an important role in older engineering disciplines. How would you construct a plane or a building without any diagrams to work from? You could do it, by describing measurements using only words and equations, but it would be painfully inefficient and error-prone. Why would you not want a picture of the thing you’re about to create? For software engineering, UML seems to slot naturally into this role.

We also noticed that software development requires you to think at different levels of abstraction. Initially, the work is highly abstract, big-picture stuff: whiteboard sketches and high level specifications, both of which have often been done with UML (or, historically, other diagrammatic notations). Work then progresses to more concrete and finely detailed stuff: code. There seems to be an obvious distinction here: a design phase, complete with diagrams, and a construction phase.

But this was always a conceptual mistake. Both activities are design, and there isn’t a construction phase at all (at least, not one that has any significant cost). The big-picture diagrams and the finely-detailed code are both purely intellectual; they’re both part of a single problem-solving exercise — one big design phase. The problem solving doesn’t stop until the coding is finished, and it often goes back on itself, with some whiteboarding required in the midst of coding. What would you think of the engineering of aircraft, buildings, etc. if you knew that the engineers routinely conducted critical redesign work half-way through physical construction? It’s not so much that software engineering is radically different3, but that we’ve been misusing the terms.

Real-world SE uses the term “building” or “build process” to refer to a set of automatable steps — compiling, linking, packaging, running unit tests — that turn the code into a finished product4. SE education forgets this a bit, but it’s a much closer analogue of the construction of a physical object than is the concept of the software “implementation”.

Once you accept that coding is, in fact, fundamentally a design activity, you realise that you cannot really teach software design without coding. If you take the coding out of software design, you’re really just left with an empty shell.

Our UML unit suffered because students were unable to connect UML’s diagrammatic notations to the things software actually has to do. Buildings and planes have schematics that broadly look like the physical object; there is an intuitive spatial relationship. But software has no tangible existence. A software diagram has nothing to do with what the software looks like, because software doesn’t look like anything. Software diagrams are no more than an aid to problem-solving. And how could we expect students to undertake problem-solving — design — without access to the one notation — code — in which the solution must be written?

Ultimately, code is everything. UML diagrams are merely subsets of the information present in code. They are abstract representations that highlight a few key details at the expense of many others. This can be very useful, but only as a way of organising your understanding of the code. Almost perversely, UML shows the big picture but never the whole picture. Experienced software engineers will understand the kinds of information omitted from a UML diagram, and thus what work remains to be done. But without code, students will look upon the diagram itself as the thing they need to master, without seeing it as merely a view of something more complicated.

Last year, alongside introducing patterns, I gave students a non-trivial amount of coding to do. (In hindsight, I probably gave them too much, to the point that it became a significant drain on their time, but such things can be recalibrated.)

In the weekly practical sessions, students formed into groups of three (or so). Over the course of the semester5, they worked on developing three pieces of software: an image viewer, library catalogue and a blog editor. Each system would be developed in a different language: Java, C++ or Python6, with the students choosing which language to assign to which system. Code, of course, is not just one notation, but many. The use of multiple languages was intended to show that software patterns (and other design concepts) apply to different languages and in slightly different ways.

Each week, I gave the students a few extra requirements for each system, drawing from the topics covered in that week’s lecture. This was all non-assessable — just preparation for the tests, assignment and exam.

A further twist was that students rotated between the different projects within their group, so that one group member would work on the image viewer one week, the library catalogue the next week, then the blog editor, then return to the image viewer, and so on. This would expose each student to three different languages, and also to the challenges of working with other people’s code. In practice, students became frustrated at the inability of their colleagues to actually finish their assigned tasks. That suggests I have some more thinking of my own to do, but I hope that these frustrations themselves served as a learning experience.

The unit still includes UML as a way of organising broad concepts. In fact, the introduction of code makes it easier to talk about UML. Students and I can use it to focus on the design concepts we need to convey, without getting too bogged down in superficial syntax or arcane rules.

By giving students the opportunity to write code, we give them all the information and the complexity that software design actually entails. Armed with that insight, they are in a better position to understand what design diagrams are for, and they can use them more effectively.

  1. Well, sort of. We occasionally pay lip service to the concept of an overlap. []
  2. Almost certainly not everyone believed this. Those who didn’t probably have some entitlement to point and laugh. []
  3. Software engineering is different — all engineering disciplines are different from each other, in terms of the methods and tools used — but we need not manufacture more differences than actually exist. []
  4. Or, rather, a potentially working product. The software build process is exceptionally cheap, because it’s automatable and has no material costs, so it’s done early and often. []
  5. In practice, mostly in the first half of semester, due to mounting stress levels and triaging of study effort. []
  6. There are many possible choices, of course, but I sought languages that were widely used and represented a diversity of approaches, but which basically adhered to the traditional OO paradigm. Java is our baseline teaching language (giving it the edge over C#). C++ stands out because of its pervasiveness and unique (if somewhat horrible) challenges. Python is a good representative of the dynamically-typed languages. []

Fred Singer’s climate consensus denial

So I read with some bewilderment1 a recent article by Professor S. Fred Singer on climate change. It jumps around a bit but mostly tries to attack the idea of scientific consensus. Singer’s logic leads from platitudes like this:

Scientific veracity does not depend on fashionable thinking.

to risible conclusions like this:

In other words, the very notion of a scientific consensus is unscientific.

This makes less sense than the reader comments beneath climate-related news articles. Take any established theory from any other scientific discipline — General Relativity, the Standard Model of particle physics, Evolution, Germ Theory, Genetics, etc. ad infinitum. If you follow Singer’s logic, these are all “unscientific”, not just in spite of overwhelming scientific support, but actually because of it. Presumably something can only be “scientific” if a large number of scientists disagree with it. This takes denialism to a whole new level.

The fallacy underlying Singer’s thinking (assuming, for the hell of it, that he’s actually being honest) is that “consensus” is equivalent to groupthink. Singer hasn’t apparently grasped the idea of a conclusion being arrived at independently by many people. But that’s what you should generally expect to happen if (a) we live in a universe that obeys rules, and (b) those people apply sufficient rigour in their observations and analysis, as scientists are expected to do.

But why is consensus important? Because we rely on experts all the time. An “appeal to authority” is perfectly rational when there is a disparity in expertise, as between climate scientists and laypeople. It’s not the scientists who rely on scientific consensus. They rely on rigorous observation and analysis. But laypeople lack the time and expertise to do the same, and for them (us), the notion of a scientific consensus is immensely important as a way of assigning credibility to particular scientific ideas.

Singer’s article actually begins by denying that any consensus exists at all, which is contrary to a number of surveys, and (if you pay attention to those who write about this sort of thing) the absence of any significant pool of climate expertise on the sceptic side of the debate. Singer is aware of the 97% figure — the proportion of climate scientists who agree that climate change is real and human-cased. His response? First of all:

The degree of consensus also depends on the way the questions are phrased.  For example, we can get 100% consensus if the question is “Do you believe in climate change?”  We can get a near-100% consensus if the question is “Do you believe that humans have some effect on the climate?”  This latter question also would include also local effects, like urbanization, clearing of forests, agriculture, etc.

The word “some” (underlined by Singer) is the key to his whole argument — an issue of wording on the survey questionnaires. Here are three surveys (of actual real-world climate scientists or climate science papers) that have each independently reported a 97% consensus:

  • One by Doran and Zimmerman (2009) that I discussed three years ago, which asked scientists the question: “Do you think human activity is a significant contributing factor in changing mean global temperatures?” (my underlining).
  • One by Anderegg et al. (2010), which classified 1,372 climate researchers as either convinced or unconvinced of the IPCC’s position, which is of course that humans are making a significant contribution to global temperature increases.
  • Another by John Cook et al. (2013), who examined and categorised 11,944 climate-related abstracts. Abstracts that minimised the impact of humans, or claimed that humans contribute less than half of the total effect, were counted as a rejection of anthropogenic global warming (AGW). This is another term for human-cased climate change, of course, but one that makes explicit its global nature.

In order words, the bar is set a lot higher, and so the consensus a lot more meaningful, than Singer makes out. Those who believe that humans are having “some” effect on the climate, but only a local or minimal one, have not been counted in the consensus.

Singer himself brings up a fourth survey by Oreskes (2004), which also found a consensus view among published papers. Singer only mentions this in order to dishonestly imply that something scandalous happened:

…after being challenged, Oreskes discovered having overlooked some 11,000 abstracts — and published a discreet Correction in a later issue of Science.

The “discreet” correction is advertised in large capital letters across the top of the downloadable PDF. The correction says:

The keywords used [in searching for papers] were “global climate change,” not “climate change.”

Not quite the same thing as “overlooking 11,000 abstracts”, which is Singer’s preposterous interpretation2. And notice that even the correction itself, raised by Singer just to spread doubt, again undermines his own point — we’re talking about global climate change here, not local effects.

In the midst of this, Singer has the audacity to cite his own survey without furnishing us with the wording of his questions3, finding of course that support for human-caused climate change is much lower. He does, however, tell us that it was done in 1990 with less than 100 respondents. It was also apparently targeted at the American Meteorological Society, because:

I figured those must be the experts.

Just smell the rigour. Meteorologists are not the experts — climate scientists are. But even if we assume the survey was done rigorously, it’s still much smaller than all of the above-mentioned surveys, and 24 years out of date.

But Singer also confuses surveys of climate scientists with public opinion polls:

On the other hand, independent polls by newspapers, by Pew, Gallup, and other respected organizations, using much larger samples, have mirrored the results of my earlier AMS poll.  But what has been most interesting is the gradual decline over the years in public support for DAGW, as shown by these independent polls.

The public does hold a much more cynical view of human-caused climate change than climate scientists, but Singer’s comparison here is utterly absurd. “Respected organisations” these pollsters may be, but what they do has no bearing on the existence (or otherwise) of a scientific consensus. They’re surveying laypeople, whose understanding of scientific issues is more a function of media coverage and ideology than of observation and analysis. Does Singer not understand the difference?

His other notable example is the “Oregon Petition”, said to have been signed by 31,000 “scientists and engineers”, 9,000 with PhDs. It’s clear that the list of signatories to the petition includes a very broad swathe of qualifications, most of which have nothing to do with climate science, and the majority of which probably have no connection to the active pursuit of scientific research at all (since a PhD is a basic qualification for a researcher in academia, and since less than a third of signatories claimed to have PhDs). The petition’s website itself states that only 31 signatories have a “climatology” qualification, a mere 0.1% of the total. It doesn’t say these are even PhDs, so they almost certainly include non-scientists. After all, the petition failed to ask signatories what they actually do, or in fact anything about them at all other than their name and self-reported qualifications (making the list impossible to verify). Singer also doesn’t concern himself with the difference between a petition and a survey. The former gives us a big, but ultimately meaningless number. The latter, more usefully, gives us the proportion of respondents (experts, in our case) who hold a certain view.

Singer’s other argument against the existence of the consensus is that there’s a global peer-review conspiracy. He complains about the corruption of the process — as evidenced by a few anecdotal examples gleaned from the “climategate” collection of stolen emails, in which scientists and journal editors are seen to be exercising their professional judgement. The whole point of peer review, of course, is to act as a front-line filter against the least meritorious scientific papers. Of course someone, somewhere, is going to have been making recommendations and sending communications about the worth or worthlessness of certain papers. The fact that so few climate sceptics ever get past this first hurdle annoys them terribly, but it doesn’t mean that the peer-review process across the world’s entire climate science community has become mired in systemic corruption. It could simply mean that said climate sceptics are full of shit (and doubly so for then claiming persecution). Given the quality of Singer’s other arguments, it’s hard to give him the benefit of the doubt.

Singer also briefly wheels out the “no warming for 15 years” myth, and complains that the fact of it having been the warmest decade on record is irrelevant. He comes armed with this self-defeating analogy:

It may help here to think of prices on the stock market.  The Dow-Jones index has more or less been level for the last several weeks, fluctuating between 15,000 and 16,000, showing essentially a zero trend; but it is at its highest level since the D-J index was started in 1896.

Singer argues that the current level does not indicate the trend, which is technically, pedantically true, but we’re never just talking about the current level. By saying that the Dow-Jones — or the current temperature — is the highest it’s ever been, we’re relating it to past levels, which is what a trend is all about. Singer just doesn’t want to admit that there’s such a thing as a long term trend that overwhelms whatever short-term trend he might find interesting. In the course of arguing that the Dow-Jones hasn’t changed much in weeks, Singer is actually conceding that it has changed considerably over the longer term. So, of course, has the global temperature. And it’s the long term trend that matters.

That’s certainly the case for climate models, which Singer laughs off for their apparent inability to explain short-term natural variability. But short-term variability is basically irrelevant in determining the broad magnitude and impact of climate change. A model doesn’t get “falsified” for failing to produce a level of precision that it doesn’t need and was never designed to produce. Run the models against the past temperature record and they quite successfully predict the large-scale shape and magnitude of the rise that we’ve observed.

Singer ends with a plug for one of his own creations:

The wild claims of the IPCC are being offset by the more sober, fact-based publications of the NIPCC (Non-governmental International Panel on Climate Change).

This is sheer delusion from the man who set up the NIPCC, which appears to be a group of cranks angry at not being taken seriously. The IPCC already considers and incorporates into its reports the full range of scientific opinion on climate change. Far from being “wild”, its claims are often considered quite conservative. Singer’s claims are nothing but denialism.

  1. In the naïve sense of one who expects intellectual honesty. []
  2. Presumably someone did a search for “climate change” and noticed that the tally of results was 11,000 higher than that reported by Oreskes. You might think that the simple, accidental omission of one of the search terms would explain the disparity in results. But the climate sceptics, bastions of reason that they are, know that really Oreskes must have had all those extra papers at hand and dishonestly or incompetently misplaced them. Because that sounds better. []
  3. For instance, did Singer ask survey respondents whether they believe that humans will cause the world to end, and did he count each “no” response as a rejection of human-caused climate change? He doesn’t see fit to tell us, even after raising the issue of wording. []

Pre-emptive fact busting

I have a theory (or, really, two theories) about what goes through Tony Abbott’s mind in situations like this. The context, so as not to get too far ahead of myself, is that Indonesian doctors appear to be treating burns of asylum seekers who claim mistreatment at the hands of the Australian Navy, as they were turned around mid-voyage.

Scott Morrison quickly pronounced this to be “sledging” with “unsubstantiated claims”. This is the political, amoral intellect of Morrison at work: conflating “unsubstantiated” with “incorrect”. Morrison’s own say-nothing policy must contribute greatly to the difficulty of determining the truth, one way or another, of such a claim. It can hardly have been “sledging” if, hypothetically, it turns out to have been accurate.

However, Tony Abbott has since backed up Morrison by also pointing to the lack of evidence. But absence of evidence is not evidence of absence.

We might ask what sort of evidence Morrison and Abbott would expect. These events took place at sea, where (I presume) the only witnesses were the asylum seekers themselves and navy personnel. Clearly the asylum seekers’ claims don’t count as evidence in the eyes of Morrison and Abbott, and we don’t have access to any information from the navy’s perspective. Morrison and Abbott expect the media to carry the entire burden of proof for something only the government (for now, anyway) has any real information about.

Abbott poses this question:

Who do you believe? Do you believe Australian naval personnel or do you believe people who were attempting to break Australian law?

Who do I believe? For a start, I’m disinclined to believe a man, Prime Minister or not, who frames the vulnerable and dispossessed as criminals1. What kind of moral compass can such a man possibly have? I’m also disinclined to believe a man who asks us to simply ignore serious allegations in lieu of spending a modicum of time and effort investigating them. We don’t have to just “believe” one side or the other. A little transparency is not too much to ask in a democracy, surely.

Of course, it’s problematic to accuse unspecified defence force personnel of abusing asylum seekers, because these are people to whom we feel collectively indebted for the personal risks they take on our behalf. But they are not superhuman, and it is not actually that hard to believe that abuses might have occurred. These are human beings in relatively isolated, probably very stressful situations, acting in the context of a brutal government policy. And there are unfortunate precedents for abuse within Defence and within our police forces. People in authority are not always flawless.

One pressing political question is this: how would Morrison and Abbott react if the media now does uncover more substantive evidence of abuse?

Whether or not Morrison and Abbott intend it, turning on the outrage early in a debate seems to cement the debate in place. If you tried this, you might worry about looking like a fool, especially if evidence is later uncovered that undermines your position. But in politics, perhaps, the early-outrage strategy actually creates a certain imperviousness to future revelations. If you’re a high-profile person, and you can articulate a hard-line position, you can make a lot of other people very angry in sympathy with you, and angry people have a habit of not quite thinking things through. Angry people treat new information not as information, but as ammunition, either fired at them by the enemy2, or available for them to fire back. In this view of the world, you never make mistakes, never need to issue an apology and never need to readjust your thinking. Even in the face of hard evidence of abuse (again, hypothetically), a political leader with sufficient willpower, and a sufficiently faulty moral compass, can plough straight through, with the ironclad support of people who worship strong leaders and who care more about political victories than about good policy outcomes.

Of course, the other theory is that Morrison and Abbott are just flying by the seat of their pants, just saying whatever seems most expedient right now, with undiluted confidence in their ability to later dig themselves out of a great steaming pile of whatever they may now be getting themselves, their party and their country into. If this theory is correct, then there is at least hope that Morrison and Abbott may be inclined, after a bit of kicking and screaming, to do something about the excesses of the implementation of their policies.

Morrison’s training for the immigration portfolio, I can’t help but noticing, has consisted of years in opposition of saying whatever seemed expedient (in the course of raising awareness of the horrifying menace of dispossessed people coming to our shores and asking for asylum). Abbott similarly veers so far from doing anything constructive (say, in the areas of fiscal management, environmentalism, public transport and education, to name a few), that it’s hard to tell if he’s actively trying to be an arseclown, or if he’s just never worked out how (or even why) not to be one3. At some point, he’s probably been told to just keep doing what he’s doing and call it a strategy.

There will certainly be a lot more arseclowning to be done before this issue is settled.

Addendum (24 Jan 2014)

A couple of extra links:

  1. Wasn’t it all about saving lives at sea, at one point? []
  2. “The enemy”, of course, consists of a core of people who are behaving in exactly the same way as you are, but with the opposite objective, intermixed with a group of people who really wish you would just listen to what they have to say for a moment and stop acting like a twat. []
  3. Abbott’s rise to power demands a considered explanation, but it seems principally the result of an almost unparalleled ability to tear down other people and rally opposition against them. []

The Constitution of Australia

In preparation for the commemoration of Australia Day1, I present to you the (somewhat abridged and edited) Constitution of Australia:

  1. The continent of Australia was willed into existence by the arrival of the First Fleet in 1788, having previously comprised isolated stretches of coastline on Dutch maps.
  2. Don’t mention the massacres. I mentioned them once, but I think I got away with it.
  3. The Commonwealth of Australia is one of four countries in the world, the other three of which are collectively referred to as “Overseas”, and include “Western Christianity”, “Asia” and “Islam”.
  4. The Commonwealth of Australia is founded on Western Christian values (delete whichever is inconvenient): racial superiority, forgiveness, conquest, humility, colonialism, tolerance for others, surprise, fear, ruthless efficiency, an almost fanatical devotion to the Pope and nice red uniforms.
  5. As Australia is founded on such openness, it cannot afford to let anyone else in who might dilute that openness, or otherwise embarrass its morally flawless citizens into living up to what they claim to believe in.
  6. The legal system of the Commonwealth is firmly based on the Ten Commandments and Deuteronomy, with the exception of the first, second, third, fourth, sixth, ninth and tenth commandments, and all the slavery, death, animal sacrifice and prohibitions on divorce, adultery and the mixing of otherwise innocuous things together, and aside from a few extra fiddling prohibitions we’ve implemented against rape, assault, deprivation of liberty, fraud, extortion, possession of drugs and firearms, etcetera. Firmly based, you understand.
  7. The monarch of the UK is on loan to Australia in perpetuity, to save on costs. He/she doesn’t really have any power, except when actually visiting the country, in which case all citizens are required to become gibbering idiots overwhelmed by gushing affection. In practice, the head of state is the Governor General, but he/she doesn’t really do anything either. Except once or twice, but you have to be Really Surprised about it.
  8. The head of government, operation of parliament and rights of the citizens are left as exercises for the reader.
  9. All citizens with incomes of $200,000 per year (adjusted for inflation) or more are permitted to whinge in the national media about “not being rich”, due to the unavoidable costs of living in a $1.5 million house with three cars, four refrigerators and a boat, and sending five children to private schools partly funded by the taxpayer. All other citizens are required to empathise with due weeping and gnashing of teeth.
  10. Elections of the House of Representatives are to be held no later than every three years, following a mandatory six-month period of intense speculation about electoral tactics. During this period, no substantive policy debate is permitted.
  11. The electorate is prohibited from electing a minority government, or choosing different outcomes in House of Representatives and Senate elections. The penalty for disobedience is a term of incoherent shouting from political commentators, followed by pledges from all parties never work with anyone ever again.
  12. The parliament is prohibited from implementing policies with planned outcomes more than three years in advance. The penalty for a violation is a term of incoherent shouting from political commentators followed by ruinous election defeat.
  13. Parties in office are permitted a maximum of six major scandals per term of office, and a minimum of four, to be approved via incoherent shouting from political commentators.
  14. The Federal Executive Council must contain a minimum proportion of arseclowns (initially 33%, to be adjusted upwards as determined by the parliament), defined as those members elected to safe seats who would not have been permitted into adulthood save for party affiliation.
  15. New Zealand is a state, whatever it says. Western Australia may or may not be a state depending on how much GST revenue it provides.
  16. Additional states may be approved on the basis of participation in the AFL or NRL.
  17. Australia is required to win every sport ever invented. Failure to do so is a National Disgrace, and requires that funding be stripped from science and education to compensate.
  18. Amendments to the Constitution must be approved by referendum, the outcome of which is “no”.
  1. The anniversary celebration of a bunch of Europeans taking over an inhabited continent and pretending it wasn’t. []

Teaching SE: from UML to Patterns

In teaching software engineering at Curtin Uni, we have long had a 2nd-year unit that dealt principally with the grandiosely-named Unified Modelling Language (UML), that diagrammatic language that promised to be software’s answer to the technical drawings of other engineering disciplines. I recall it as a student, when the various UML notations (each one allowing you to articulate a particular aspect of the software you’re designing) were described at a rate of approximately one per lecture (with one lecture per week). At the time, not knowing any different, this seemed a logical approach to useful design material.

As a mathematical system, UML draws you in. Pure abstract curiosity drives you to understand what its constructs are for and how they relate to one another. It has a kind of internal elegance, if you know where to look, where a few core concepts can be used to articulate systems of great complexity with great subtlety and flexibility. Its creators made mammoth efforts to anticipate all the situations they wanted to be able model with a diagrammatic (or semi-diagrammatic) language, and provided the ultimate multi-purpose tool for the job.

UML positioned itself throughout the “software life cycle” (another curious term) but particularly in the design phase. It was supposed to be the vocabulary in which you expressed the bulk of your design work. You crafted UML diagrams from a requirements specification, then, once the UML “model” was complete, it became a blueprint with which you could hammer out the code in trivial time.

There are probably quite a few ways to explain why (in many cases or even most cases) this doesn’t really work. UML has a role in SE, but not one quite as celebrated as its evangelists might have thought. It is a vocabulary, one used to communicate complex, abstract ideas quickly. But not completely.

UML serves a useful role as an informal language, not a specification language, and the difference is completeness. UML can be complete — that was the whole idea according to some people — but practically speaking you don’t usually want it to be so. At the day-to-day level of human communication, you don’t need to be complete — you merely say as much as you need to say before the other person “gets it”. We trade off completeness for efficiency. When you want someone to understand what you’re thinking, you estimate the differences between your understanding and their understanding, and you communicate only those differences, not the sum total of your thoughts. In UML, you would draw only those entities and relationships that are relevant to the immediate issue at hand. (We take a very different approach when writing code and specifications, in which all details must be carefully articulated.)

In the second half of 2012, 11 years after I took the UML unit as a student, I was asked to teach it. The unit had evolved slightly in the way that units do, but the approach was broadly the same. Over the years, it had occasionally attracted the nickname “Diagrams 252”. People knew that the emphasis of the unit was misplaced. Now that I was on the other side of the educational fence, I came to see the problem in our teaching approach — not just in what we were telling students about UML, but in what we were failing to tell them about software design more generally.

UML is a vocabulary, formal or informal, but so what? Software design isn’t about syntax. It’s about ideas. What should you actually do with all those notations? Where was the actual design? Where was the engineering?

In many an SE textbook, there is no shortage of advice on what you shouldn’t do in software engineering. There are rules about how not to use inheritance, what language constructs you should avoid at all costs, what kinds of coupling are unacceptable, etc. There is usually not a great deal of advice about what you should or even can do.

Exposing students only to a set of rules and notations, as we did previously, is really just fiddling around the edges of SE education. The knowledge that creates a competent software engineer is not UML or design checklists. Rather, a competent software engineer first and foremost needs a mental toolbox of design options — a large collection of adaptable solutions to small problems, stored in one’s brain. These are not memorised in the way that students often try to memorise bullet point lists. They are not catalogued in a neat little taxonomy as might appear in a traditional textbook. They are haphazard fragments of possible design approaches — the result of seeing how design could be done in various ways. The technical term from cognitive science, as I understand it, is “plan”. Plans are building blocks for the creative and investigative processes.

One can acquire such a mental toolbox through sheer brutal personal experience — that’s how they did it in the old days, of course. But education is supposed to short-circuit that, or else what’s the point?

In teaching the unit for a second time in 2013, I made some significant changes, one of which was to teach software design patterns1. It’s easy to make the argument for teaching patterns, because they have that aura of academic respectability that accompanies things Published by Reputable Authors. Patterns, of course, are broadly defined as reusable solutions to common problems. They are implemented independently by different engineers in different contexts, and later discovered for what they are. Familiar?

The logic here is more convoluted than it first appears. A pattern is not a plan — not exactly. Each pattern is a named phenomenon (the “Strategy Pattern”, “Observer Pattern”, “Composite Pattern”, etc.), analysed, documented with UML and catalogued. The widely-known seminal list of software patterns was laid down in a book by the “Gang of Four”. So, for educational purposes, patterns sound a lot like a giant list of bullet points that students would simply try to memorise.

But patterns are important for educational purposes because (unlike UML itself or the usual what-not-to-do list of SE design rules) they show you what you can do. Patterns are solutions known to work well, assuming you understand what each one is for. Moreover, it has been my hope that teaching patterns also reveals some of the more fundamental ideas about software design. That is, even if you can’t remember a single actual pattern after taking the unit, you might nonetheless remember some interesting things you can do with polymorphism. Hopefully some knowledge underlying those patterns will have rubbed off, and given you the beginnings of that mental toolbox.

  1. There had always been a single lecture on patterns anyway, but it didn’t cover much material. []


I’ve decided to drop the attempt at anonymity and put my actual name to what I write.

Some readers of this blog already know who I am. For the rest, no, sadly I’m not Scott Morrison’s split personality, Clive Palmer’s secret robotic dinosaur, or a time-travelling, sapient descendant (employed as a short term foreign worker) of a bacterium lurking on the Gina Rinehart Poetry Rock. It may shock those of you who follow me on Twitter to learn that my last name is not even “Orgillous”.

I’ve put some details of myself on the About page, and you’ll notice a brief “Who Am I?” on the side.

Still, I don’t think it’s necessarily important that bloggers in general use their real names. A good argument is a good argument, irrespective of the arguer. Sometimes (though this doesn’t apply in my case) anonymity creates an opportunity for those in difficult circumstances to voice their opinions.

WA election rerun

It’s not decided yet, but the odds look good for a new WA senate election, to clear things up after the AEC’s recount discovered 1375 missing votes. (I gather from Antony Green that the AEC actually knows what these votes were, or at least how they were originally counted, but they can’t be used in the recount unless they are actually recounted.)

There’s a delightful arcane complexity to the logic behind the counts themselves. It’s a question of the Shooters and Fishers vs the Australian Christians. Neither of them have a hope of being elected on their numbers, but (essentially by pure luck) that two-way contest happens to decide between four other parties. The original count had the Shooters winning against the Christians by 14 votes, setting up Labor and Palmer United for a win against the Greens and the Sports Party. The recount (with 1375 votes missing) turned this around into a 12 vote relative victory for the Christians, leading to a actual Greens/Sports victory.

It all seems a bit like a series of football matches in which, due to complex points calculations, the fate of your team actually depends on a game they’re not even playing. However, in general, organisers of sporting competitions don’t suddenly decide to reverse the result of a match played eight weeks ago between two of the bottom teams, leading to the current set of finals contenders suddenly being rounded up mid-game and replaced by a bunch written off three weeks ago.

Possibly the most counter-intuitive thing is this: if just a few Labor supporters magically had foreknowledge of this complex turn of events, they might have realised that a vote for the Shooters would do more to help Labor than a vote for Labor itself. The same would be true of Palmer United and the Greens, though Greens supporters would have had to vote for the Christians, of all people.

A new election will wipe the slate clean, in a way, but Labor and the Coalition have begun to play an interesting game there. According to the Coalition’s Warren Truss — our new Deputy Prime Minister:

I think if there is a new election … it needs to happen as quickly as possible so there is as little distance between the atmosphere and the issues that decided the election in September and what will be on the table at the time that a new WA poll is held …

Meanwhile, Labor’s Tanya Plibersek (Acting Opposition Leader) says this:

It is important that the investigation [into the missing 1375 votes] is given an opportunity to run its course.

Once that investigation’s given an opportunity to run its course, we’ll have to make a decision about the way we can best be confident that the voice of every Western Australian has been heard.

Spot the difference. The Coalition wants to get it done ASAP, but Labor wants to make sure all the details are known, which of course may delay things a bit. According to Antony Green, the election rerun must occur “by the latest in early May”. The Coalition would probably be concerned — and Labor might be somewhat enthusiastic — about a shift in public opinion between now and then.

In the disputed recount, the Liberals won 3 seats, while Labor, the Greens and the Sports parties won one each. One seat out of six is a pretty poor showing for Labor, and it looks like it was only 0.14 quotas away from a second in its own right. In an election rerun, depending on the evolution of public opinion, Labor and the Greens could do quite a lot better.

If Labor/Greens come away with three seats together, they would have 36 senate seats in total. This could come at the expense of either the Sports Party or the Liberals. Either way, the bargaining power of the other Senate cross-benchers would be significantly increased, and Abbott’s options for getting things through the Senate would be diminished.

If things go particularly disastrously for the Coalition, and Labor/Greens come away with four seats in WA, and so 37 senators overall, they could combine with Nick Xenophon to block legislation such as the carbon tax repeal. (Senate votes require a majority of more than half. There are 76 senators, so the government needs 39 of them to pass legislation, and the opposition needs 38 to block it.)

The Coalition presumably knows this, and will probably spend the election campaign1 whinging about Labor’s carbon tax and the threat to civilisation and indeed to the very fabric of reality that it poses. But Labor can itself spend the campaign pointing out that Abbott isn’t big on public transport funding, GST revenue, or whatever other issues float into view at the time. And everyone else can talk about the election in a changed context — we’re not deciding which party actually governs, but rather how best to hold the government to account, which of course presupposes a particular answer.

And so the game is this: the longer that it takes to hold a new WA senate election, the more likely it is that Abbott’s “honeymoon” period will wind down in the mean time, and voters will start to assign responsibility to him and the Coalition for any failings of government. This is presumably what Truss is hinting at when he talks about the “atmosphere and the issues”. He wants to avoid an election rerun being used by voters to pass judgment on the Coalition, because, conceptually, this would still be part of the election that brought them to power in the first place.

I wonder if the WA public will see it like that. In any case, WA politics may soon — if just briefly — become very important to the rest of Australia.

  1. There has to be a campaign even for an election rerun. []

Climate Policy and Democracy in 2013-14

Tim Dunlop argues that Labor, having lost the election, should yield to Tony Abbott’s right “to govern as he sees fit”, and help him repeal the carbon tax. According to Dunlop, the “norms of democratic governance” are at stake. I find his reasoning a bit simplistic, but I’ll get back to this.

A range of new Senators will take their seats in July 2014. Beyond that point, Abbott will need to negotiate for the support of the Palmer United Party plus any three out of Democratic Labour, the Liberal Democrats, Family First, Nick Xenophon and the Motoring Enthusiasts. (The Coalition will have 33 Senators of its own, and needs 39 out of 76.)

It’s still possible (given Scott Ludlam’s appeal) that a Senate recount in WA may eventually go ahead, despite the AEC’s initial rejection, and deliver an alternate outcome: Palmer United losing one senate seat to the Sports Party1. Then Abbott’s options are slightly more complicated: he would need any six out of the DLP, LDP, FF, Xenophon, Motoring, Sports, and two PUP senators.

On the carbon tax, the various positions are as follows:

The odds seem to be in favour of Abbott getting the numbers, but there are scenarios in which he doesn’t. Any two of Muir, Dropulich and Lambie2 could combine with Xenophon, the Greens and Labor to block Abbott’s plans, and the likelihood of that depends on a lot of things we just don’t know at the moment.

You might think that single-issue parties like the Motoring Enthusiasts and the Sports Party are unlikely to put up a fight when it comes to non-core issues (things other than Motoring and Sports), particularly when the issue in question is the Prime Minister’s single most emphatic election promise. But then Xenophon himself previously ran on a “No Pokies” ticket, and isn’t shying away from the climate change policy debate. And Family First can’t reasonably claim that their policy is motivated by anything to do with families. The outcome probably depends more on the character of the new senators themselves than their respective party platforms.

But the outcome also depends on Abbott’s ability to negotiate with all these people simultaneously, including Clive Palmer. Even with enough Senators who want to repeal the carbon tax, how many of them will want to secure special deals beforehand? How much will they try to milk Abbott, before letting him have his victory? Clive Palmer in particular could…well, do anything. The carbon tax might remain in place by virtue of endless bickering over the precise terms of its repeal. Maybe. Who knows?

Well, the Labor Party itself could put an end to this speculation, if it wanted. And it could happen now, rather than in mid-2014. Where the ALP votes with the Coalition, all other parties and independents are irrelevant. This is what Tim Dunlop wants.

I’m sure some will disagree and say that the environment trumps everything, that addressing climate change is the most compelling issue we face, and that you can’t practice politics on a dead planet. Fair enough.

But I would say in response that politics is the only way we have of implementing planet-saving policies in the first-place. Every move we make that undermines the legitimacy of the process itself damages the main tool we have to bring about the change we want.

Dunlop’s argument would have some legitimacy if the fate of democracy really was in the balance, but he hasn’t made that case.

After all, why is it that the Labor Party has the power to keep the carbon tax in place in the first place (at least temporarily)? This power, even in opposition, is a product of Australia’s representative democracy, not an anathema to it. Our democratic system was designed this way for a reason. What is the point of the upper house if not to be a check on the lower house? The Senate is elected too, remember, and Abbott has not won the Senate. Not yet, anyway.

Dunlop appears to fear the idea of political deadlock, as exemplified in the US:

There, a rump of the Republican Party, in the form of its so-called Tea Party members, is currently destroying not just Congress itself but the nation’s faith in its ability to effectively govern itself.

The ramifications of that are huge, and we shouldn’t let it happen here.

But it can’t happen here. Australia has constitutional mechanisms to resolve such deadlocks if and when they occur. If the Senate repeatedly rejects government legislation, the government can call a double dissolution election. Abbott has been talking up this possibility for a long time. Also, should it ever be needed again, the Governor General has the power to sack the government, triggering an election. One way or another, these mechanisms will shift the balance of power by re-consulting the voters.

The US has an additional challenge in the form of low voter turnout, if voters become disillusioned. Compulsory voting in Australia largely solves this.

Dunlop also makes this point:

The system asks that both winners and losers of the democratic competition accept some level of humility. Compromise is built into the fabric of democratic governance and no-one gets all of what they want.

The problem with abstract discussions on compromise is that, while compromise is almost universally agreed to be essential, there simply aren’t any rules about when and how it happens, and who must compromise more. There can’t be any rules, because compromise is an inherently rule-breaking idea. The appropriate degree of compromise depends entirely on the situation at hand, not on any general principles. It’s circular reasoning to employ “compromise” as a reason for why one side should give in.

But say, even, that we are aiming for some arbitrary level of humility and compromise from both sides. If Labor voted to repeal the carbon tax, what “humility” and “compromise” has the Coalition had to endure?

Dunlop tries to eke out a somewhat nuanced position. He does acknowledge up-front that:

A party that claims “we won the election therefore we get to do whatever we want” is not citing any sort of constitutional truism: it is strategically deploying a rhetorical trope in order to get its own way.

But I have difficulty separating this “rhetorical trope” from Dunlop’s own argument. He has not immunised himself from it merely by explaining it. His only real premise is indeed that the Coalition won, and he does speak of the “rights”3 of said winner to do essentially whatever they like. This is a simplistic interpretation of representative democracy, and it is effectively repudiated by the constitution.

Although its power may not last, Labor has every reason to block the repeal of the carbon tax. Its ability to do this is not some murky result of arbitrary, incomprehensible parliamentary rules, but of basic democratic process. Tony Abbott will have the authority to repeal the carbon tax when he has the numbers to do it, not before.

  1. And also Labor (Louise Pratt) losing one seat to the Greens (Scott Ludlam), but that won’t change things as far as the carbon tax is concerned. []
  2. And/or others, of course, but those three seem the most likely. []
  3. I would have thought words obligations and privileges might be a better choice than rights. By being elected, you gain obligations, and certain privileges needed to carry them out. []

Fun with Senate GVT Data

As I learnt from the Poll Bludger, the Senate group voting tickets were released a few days ago. (The data is available in CSV form from the AEC: NSW, Vic, Qld, WA, SA, Tas, ACT, NT.)

Group voting tickets (if you don’t know) are the way most voters choose to vote on the senate ballot paper. They are the above-the-line option, where you choose one party only, and (perhaps unbeknownst to many) cede your choice of 2nd, 3rd, etc. preferences to that party. A GVT is a list of preferences for senate candidates, decided in advance by each party. You can either select a GVT (whose details are not shown to you on the ballot paper, except for the first preference), or number all the candidates.

I thought it would be interesting to see how the pantheon of parties ranks itself. Which parties are closer to the front of the other parties’ preferences? Which parties are despised by all? Where do the major and high-profile minor parties come?

Here they all are. I’ve included every political party and independent contesting senate seats in every state and territory. The bars on the graph1 represent the median position of a party among all parties’ preferences. Smaller bars are preferable, indicating that a party is closer to the front of overall parties’ preferences. I stole the colour coding from the ABC.

(Note: there’s nothing predictive about this graph. It’s just a representation of what the different parties think of each other.)


Parties contesting senate seats differ state-to-state. Independents and many minor parties run in one state only. Other parties have subtly different registered names in different states. I’ve tried to remove these inconsistencies in the graph. However, the Liberals and Nationals further confuse things by being the same party in Queensland but not anywhere else.

Anyway, here are some observations:

  • Australian First Nations occupies the most favourable position by a wide margin, though they are an NT-only party.
  • The Australian Sports Party is next, perhaps in keeping with our vaunted national identity, and/or perhaps because it’s a feel-good concept that compares starkly with the entrenched ideology of other parties.
  • Most established, high-profile parties lie at the bottom of the list, towards the end of overall parties’ preferences. The more we see of our political parties, the more faults we find. Moreover, the established, high-profile parties are probably the ones considered the largest barrier to the chances of all other parties.
  • The Greens are fourth-last, and are perhaps in the unenviable position of being seen as an “establishment” party even while struggling to maintain a presence in the House of Representatives.
  • Family First, meanwhile, seems to have attracted disproportionate magnanimity. Did Steve Fielding really capture our hearts after all?
  • The wisdom of our political tacticians has placed Bob Katter slightly ahead of Clive Palmer2. It will be interesting to see if either makes a dent in the status quo.

It’s curious that the major parties should be so far down the list, considering the undisguised craziness of others like One Nation, Rise Up Australia, the DLP, etc. Is that really the path we want to go down? Given the choice between (a) a senator from your least favourite major party, and (b) a senator from Rise Up Australia, who do you think would do the least damage?

I had also intended to use the GVT data to construct a network of parties, showing allies and enemies (where an alliance is implied by one preferencing the other before all major parties). The result is currently too cluttered to be readable, though.

  1. Actually, a bar graph doesn’t quite feel quite right, because the data represent positions rather than quantities, but it was the easiest choice. []
  2. The ABC has decided that these two are now worthy of colour coding. Palmer takes yellow from the Democrats, and Katter takes brown from One Nation. If Katter and Palmer fail, who will be next? []

Are the Greens extreme?

Some personal context: at the time of writing, I am not, nor have I ever been, a member of a political party, nor have I campaigned for one (unless you include my writings on this blog, and if you do that you’d be equating mere opinion with political campaigning). I think and write independently of any political party’s political interests. I intend to perpetuate this state of affairs.

That said, I do care about what political parties say and do. I’ve noticed a bipartisan anti-Greens position, or brand, being forged in federal politics in the last few years. It came easily to the Coalition, of course. You may recall that the 2010 Victorian state election saw them preferencing Labor above the Greens, in a break with tradition. (Strategically, the major parties usually feature last on each other’s how-to-vote cards — a move that is tactically sound but ideologically questionable.)

But Labor has since been partly goaded, partly embarrassed into joining their arch-enemies over the party that has supported them in minority government. Perhaps it was the indignation of having to negotiate the passage of legislation with someone other than the true guardians of democracy — the NSW Right. (Our current Treasurer Chris Bowen apparently thinks that, though the Labor-Greens deal wasn’t actually a mistake, it should never happen again. Presumably he will be righteously refusing any offers to form government in the event of a future hung parliament. I can’t properly comprehend the reasoning behind this. If the Greens have the balance of power, it’s either a Labor-Greens coalition or another election, and what are voters to make of a party that refuses to form government?)

This joint position on the Greens is one whose adherents speak in grim, vacuous generalities about “extremists”, a term that seems intended to de-legitimise the Greens by association with the most radical of ideological hard-liners. People who advocate wholesale violence against ethnic minorities are called extremists. People who support terrorism, or who are terrorists themselves, are called extremists. What have the Greens done to deserve the same label? Endorsed the Whitehaven coal mine funding hoax, rudely drawing our attention again to climate change1? Advocated for the human rights of asylum seekers2? We’re all entitled to disagree, perhaps vehemently, but let’s please keep some perspective.

For all that the Greens have been condemned for being hard-liners, compromise must work both ways, and the Coalition has hardly been a picture of moderation and open-mindedness. Labor has shifted its own objectives quite a lot, but mostly in a vain, clumsy effort to outflank the Coalition, rather than in pursuit of the greater good. Ultimately, the Labor, Liberal and National parties have their own established interests, and naturally resent having others take up space at the table. It is an observable truth that the Greens do make compromises. How could they not? To fail to compromise, for a minor party, even one supporting a minority government, is to deal yourself out of the game. Do the Greens compromise enough? Many would say no, but we could haggle over that forever. There is no objectively correct amount of compromise, just a lot of heated opinion.

As inferred from the first paragraph, I am not associated with the Greens in any capacity. I emphatically disagree with them on genetic engineering and nuclear technology, where I find their policies to be naïve and simplistic. These technologies have manageable risks, and oft-ignored but very real benefits, and the more we learn through scientific endeavour, the more manageable the risks will be, and the more beneficial the applications.

Nevertheless, when it comes to the ballot paper, I tend to rank the Greens above both major parties. They don’t always come first in my estimation of the lesser of various evils, but, in effect, as long as I rank them above Labor and the Coalition, I’m supporting them. I couldn’t possibly do this without Australia’s preferential voting system, which grants us all the opportunity for fairly nuanced expression of our political beliefs.

Partly this is a kind of tactical support. I’m a former Democrats voter, and parliament needs its crossbenchers to occasionally inject some constructive criticism. We need a diversity of opinions, over and above the perpetual war of words between uncritical government MPs and unconstructive opposition MPs (which party holds government being irrelevant to this state of affairs). Independents and other minor parties can also fulfil this role, of course. Were there to be only two parties in parliament, the competence of that institution would be diminished, and we would all suffer for it.

Policies do matter as well, but minor party policies are not the same kind of animal as major party policies. A minor party really only has a wish list of things it believes in, some of which it might be able to persuade the government to partly implement at an opportune moment, if it gets lucky. One should not vote for, or against, a minor party on the expectation that everything it desires will come true.

By contrast, a major party’s policies are a largely complete statement of what it, as the current or future government, will strive to implement by itself. A major party expects to implement its agenda mostly unhindered, or not at all. It has much greater responsibility for coherent, costed policy development than minor parties. It owes this responsibility to the fact that it controls the budget — such power as minor parties can only dream of.

The Greens would not be averse to becoming a major party, by winning greater public support (however unlikely that may be), and in so doing acquire this power and responsibility for themselves. At that point, we should demand that the Greens exercise fiscal prudence. However, until they do — without the power to make budgetary decisions — such demands make little sense. Fiscal prudence, when exercised by a minor party in policy development, has no real-world consequences. It is entirely symbolic and mostly ignored.

In essence, it’s power that creates responsibility, and the need to hold political parties to account. The Greens certainly have some power, even if the extent of it has been wildly overstated.

However, to merely shout “extremism” at the Greens invites questions as to one’s own capacity and willingness to engage in informed debate. Without a point of reference, the word “extreme” is meaningless, and does nothing to inform the electorate. If you think the Greens are wrong, then by all means make your case. If you want the Greens to be held to account, articulate your criticism and challenge them and their supporters to provide their own reasoning and evidence. We might all learn something from the ensuing discussion.

But even when and if the Greens are wrong, does that in itself make them “extreme”? Consider the frequency with which the major parties make their own colossal mistakes. Consider the magnitude of the damage when the government gets it wrong, and compare that to the problem of minor party naïvety. It is not “extreme” to simply be wrong, and even if you are wrong, your contribution to the debate can still be constructive, by compelling others to justify themselves. It seems to me that we have little to fear from this.

  1. The means do not, of course, justify the ends, but I dare say that the consequences were blown a little out of proportion for political convenience. []
  2. This I’m very much in favour of. []