• “Four plus seven plus three is not four”

    I first wrote about this three years ago, but my weekend project has been to migrate my blog over to a hosted WordPress account from the DigitalOcean droplet that had been hosting it up until now, and it was one of a couple of recent posts that got lost in the process.

    Rather than restoring it from archive.org, I’ve decided to post an updated version instead. At the time I couldn’t remember exactly what the question was, but earlier this year I managed to find the exercise book that I had written it in when I was seven years old. It was a straightforward exercise in adding together three three-digit numbers.

    I’d done dozens of questions just like it. Four plus seven plus three is fourteen. Four in the digits column, carry 1, which I wrote at the top with a line through it to show my working. One plus five plus six plus four is sixteen. Six carry one. One plus six plus three plus two is twelve. One thousand, two hundred and sixty four.

    I handed it in, only for it to be marked wrong.

    I went over it again carefully and I couldn’t for the life of me see where I might have made a mistake. Just to be sure, when I got home I checked it on a pocket calculator. In the years since, I’ve checked it on various computers ranging from a ZX Spectrum through various programming languages including JavaScript, Python, Wolfram Alpha and even ChatGPT. Every time I get the same result. 1264.

    I did the sum again, handed it in, and yet again it came back marked wrong. The third time, the teacher summoned me up to her desk.

    “Four plus seven plus three is not four,” she said firmly.

    I didn’t know how to respond to that. I knew that four plus seven plus three is not four. But four plus seven plus three is fourteen. It still has a four at the end, you still write four in the ones column, you just have to carry one over into the tens column, and I had even written a little “1” at the top with a line through it, as she had taught me to do, to show that was what I’d done. But Mrs Lester was a rather stern kind of teacher and I was too shy to answer back to her, so I quietly returned to my seat feeling confused, not sure what to do next, and if truth be told, a little bit offended.

    But what if the fact that she was wrong was the whole point?

    What if she was actually trying to teach me something that every good teacher should be teaching?

    Your teacher isn’t always right, and when they aren’t, you should challenge them.

    One of the most important things that every teacher should be instilling into their students is critical thinking. Asking questions, fact-checking, and not swallowing everything you’re being told hook, line and sinker are important skills.

    Now from time to time I’ve heard people claiming that they’re “encouraging critical thinking” when in reality they are doing nothing of the sort. You get this especially from conspiracy theorists and purveyors of pseudoscience, who will quite happily tell you that they are “questioning mainstream narratives” and trying to encourage you to “think for yourself.” But in reality, all they are doing is swapping out “mainstream narratives” for their own brand of pseudoscience and conspiracy theories. If you start applying critical thinking to their own claims, their enthusiasm for the aforementioned critical thinking quickly evaporates.

    If your aim in teaching “critical thinking” is simply to get your students to think like you, or to repeat exactly what you are teaching them, then you aren’t teaching critical thinking at all; you’re spoon feeding them. On the other hand, one way that you can tell that you are getting it right is that your students start challenging you.

    Introducing the occasional mistake into your teaching material can be a good way to do this, but it needs to be done carefully. The mistakes need to be ones that you should reasonably expect your students to spot, otherwise you will be teaching them misinformation. You should also make sure that you are giving your students the confidence that they need to challenge you. Stern, strict, no-nonsense or authoritarian teachers probably won’t be able to pull this off, especially with children who don’t have a great deal of confidence to begin with. But the lesson is one that every good teacher should be teaching their students. Make sure that you’re teaching them to think critically about what you yourself are teaching them—and that you’re giving them the space and the confidence to challenge you when you get it wrong.

  • Accurate and honest metric weights and measurements

    My height is 1 metre and 78 centimetres. I refuse point-blank to quote that in feet and inches.

    My weight, as of 12:30 on Saturday 19 August, is 79.8 kilograms. One again, I don’t care what that is in stones and pounds, so working it out is left as an exercise for the reader.

    Over the past three months I have made it my goal to take a five kilometre walk every day that I can. Once again, converting that into miles is left as an exercise for the reader.

    Those who have engaged in discussions with me in (sometimes lively) debates about science and faith will be aware that one particular passage from the Bible that I am always quoting, over and over again, is Deuteronomy 25:13-16, which says this:

    13Do not have two differing weights in your bag — one heavy, one light. 14Do not have two differing measures in your house — one large, one small. 15You must have accurate and honest weights and measures, so that you may live long in the land the Lord your God is giving you. 16For the Lord your God detests anyone who does these things, anyone who deals dishonestly.

    It should come as no surprise, therefore, to learn that I am an ardent proponent of metrication, frustrated at the lack of progress that the UK has made in this area since the initial push in the 1960s and 1970s, and totally opposed to any attempt to head in the opposite direction.

    This one should be a no-brainer. With the exception of the UK, the USA, Myanmar and Liberia, almost every other nation on Earth uses metric units exclusively. It’s not hard to see why either. Metric units of measurement make sense. Different measurements of the same units are related to each other by multiples of ten, with a consistent set of prefixes denoting their relationships. So getting from metres to kilometres, grams to kilograms, bytes to kilobytes and so on, you just notice the word “kilo” at the start and multiply by one thousand.

    On top of that, metric units, or SI units, are the foundation for measurement in science, engineering, commerce, finance, law, education and just about every other context where measurement is used. They are based on well defined, easily measurable, high-precision quantities. They are consistent, unambiguous, precise, easy to understand, easy to work with, internationally recognised, and exactly the same everywhere you go. They are the lingua franca of accurate and honest weights and measurements worldwide.

    Imperial measurements, by contrast, are a mess. There are sixteen ounces in a pound and fourteen pounds in a stone—or is it the other way around? Up until the nineteenth century, the number of pounds in a stone varied depending on where you were and on what was being measured. There are eight furlongs in a mile, ten chains in a furlong, 22 yards in a chain, three feet in a yard, twelve inches in a foot … how on earth are you supposed to remember all the details? British and American gallons are different. British and American tons are different. I have no idea how much a fluid ounce is supposed to be. Repeat after me: an acre is the area of a rectangle whose length is one furlong and whose width is one tenth. None of it offers you a shred of sense or coherence whatsoever.

    Someone asked me the other day on Facebook, in response to my quoting of Deuteronomy 25 yet again, whether I thought that having a mixture of imperial and metric measurements was unbiblical. I replied that it quite possibly could be. Having two different systems of measurement makes it a whole lot harder for consumers to compare like for like when trying to figure out how much something costs. Supermarkets being supermarkets, they will take every opportunity they legally can to pull off shenanigans like that. This was a concern back in the 1970s when the push for metrication was in full swing, and it would be a concern if we were to try to turn the clock back to imperial ones again.

    Unfortunately, there are certain politicians here in the UK who, in the wake of Brexit, want to do precisely that. One of the most prominent of these is, of course, the Right Honourable Member for the eighteenth century, Sir Jacob Rees Mogg, who instructs his staff, in no uncertain terms, that imperial measurements they must use. The only reason why anyone would want to do things such as this is some sort of misguided rose-tinted nostalgia for the good old days of the 1940s and 1950s or earlier. Why don’t we just bring back post-war rationing, outside loos, black and white TV, and horses and carriages while we’re at it?

  • The time I forgot about the speed of light

    The Fallacies of Distributed Computing are a set of eight assumptions, originally noted by L Peter Deutsch and others at Sun Microsystems, that are commonly made by programmers and architects who are new to distributed computing and network architecture. They are:

    1. The network is reliable;
    2. Latency is zero;
    3. Bandwidth is infinite;
    4. The network is secure;
    5. Topology doesn’t change;
    6. There is one administrator;
    7. Transport cost is zero;
    8. The network is homogeneous.

    All eight of these assumptions are wrong. In fact, these eight fallacies are the reason why Martin Fowler came up with his First Law of Distributed Object Design: don’t distribute your objects.

    The first time I fell foul of these fallacies was particularly embarrassing, because it was in a situation where I should have known better.

    I was working for a small web agency at the time. A lot of our work was graphic design, webmastering and SEO for local businesses, but we had a few larger clients on our books for whom we had to do some actual coding and server administration. One of them was an airport taxi reservations company who wanted a new front end for their online portal.

    Their database was running on SQL Server Express Edition (the free but hopelessly under-powered version), on the same server as the web front end, hosted in a data centre in Germany. Because this was running at pretty much full capacity, they asked us to move it to a larger, beefier server. Since this meant moving up to one of the paid editions, my boss did a bit of shopping around and came to the conclusion that we could save several thousand euros by moving the database to a hosting provider in the USA. Due to the complexity of the code and the fact that it was running on a snowflake server, however, the web front end had to stay put in Germany.

    He asked me what I thought about the idea. I may have raised an eyebrow at it, but I didn’t say anything. It sounded like a bit of an odd idea, but I didn’t see any reason why it shouldn’t work.

    But I should have. There was one massive, glaring reason — one that I, in possession of a physics degree, should have spotted straight away.

    The speed of light.

    The ultimate speed limit of the universe.

    It is 299,792,458 metres per second now and it was 299,792,458 metres per second then. It has been 299,792,458 metres per second everywhere in the visible universe for the past 13.8 billion years, and expecting it to change to something bigger in time for our launch date would have been, let’s just say, a tad optimistic.

    Now that distance may sound like a lot, but it’s only 48 times the distance from Frankfurt to New York. It simply isn’t physically possible for a web page in Germany to make more than twenty or so consecutive requests a second to a database in America — and many web pages in data-driven applications, ours included, need a whole lot more requests than that.

    Needless to say, when we flipped the switch, the site crashed.

    To say this was an embarrassment to me is an understatement. I should have spotted it immediately. I have a university degree in physics, and the physics that I needed to spot this was stuff that I learned in school. What was I thinking?

    Featured image by WikiImages from Pixabay

  • Light speed

    Light speed

    As you will no doubt be aware, the speed of light in a vacuum is 299,792,458 metres per second exactly. It always has been, and it always will be. In fact, so confident are physicists that it has never changed that since 1983, it has been used as the definition of the metre in the SI system of units.

    And now, here it is, in a sudoku.

    Normal sudoku rules apply. Digits on thermometers increase from the bulb end. Cells separated by a knight’s move in chess can not contain the same digit.

    Try it on f-puzzles.com.

  • Finding bugs in your code quickly using git bisect

    git bisect is one of my favourite features of Git. It is a binary search tool that lets you quickly track down the revision that introduced a bug. Surprisingly, it doesn’t seem to be all that well known, so I thought it would be worth writing a refresher on what it is and how to use it.

    git bisect: an introduction

    The idea is very simple. If you know that your latest revision has a bug that wasn’t there a few weeks ago, and you can find a “known good” revision from round about that time, you can conduct a binary search of the revisions in between to find out which one introduced it.

    So let’s say that you have 500 revisions to start off with. You’d mark the latest one as bad, then test, say, the 100th revision, find that it works as expected, and mark that as your last known good revision. Git will then automatically update to the 300th revision (halfway in between) for you to test. Mark as good or bad as appropriate, lather, rinse and repeat until you’re done.

    Each test halves the range of revisions left to be tested, quickly narrowing the gap. In total, you have to test just \mathcal{O}(\log_2 n) revisions. This means that 1,000 revisions would only take one more test than 500, and one million would only take one more test than 500,000 and ten more tests than a thousand. Once you’ve found the offending change, you can very easily zoom right in on the problematic lines of code, rather than having to spend ages stepping through it all in the debugger.

    How to use it

    Before you start your bisect session, save your work using git commit or git stash. Then to start off your bisect session, type:

    $ git bisect start

    Next you need to tell Git the range to start off with. If your current HEAD revision is the bad one, you can just mark it as bad as follows:

    $ git bisect bad

    Next check out a revision that you know to be good and tell Git that it is a good one:

    $ git checkout KNOWN_GOOD_REVISION
    $ git bisect good

    Git will now move to a revision halfway in between the two, choosing the next revision for us to test. You will see something like this:

    Bisecting: 31 revisions left to test after this (roughly 5 steps)
    [89f7bc018b5fc34c01bea545e3641ee2c77241ac] Bump version

    Recompile and re-test your code at this revision. Look for the specific bug that you are trying to track down (ignore any other bugs for the time being) and mark as either bad or good as required:

    $ git bisect bad
    $ git bisect good

    After each of these steps, Git will choose another revision halfway in between, until you end up with the revision that introduced the bug:

    $ git bisect bad
    164f5061d3f54ab5cba9d5d14ac04c71d4690a71 is the first bad commit
    commit 164f5061d3f54ab5cba9d5d14ac04c71d4690a71
    Author: James McKay <code@jamesmckay.net>
    Date:   Sun Nov 11 14:18:44 2018 +0000
    
        Move some test fixtures about for consistency.
    
    :040000 040000 d8dc665d03d1e9b37c5ee2dcde8acc032e306de8 0077c62618b69a20e5dbf6a61b42701a3ba2c156 Msrc

    Once you’ve found the offending commit, reset to go back to where you started:

    $ git bisect reset

    Some useful tips

    Use git bisect log to see a list of all the revisions you’ve checked so far:

    $ git bisect log
    git bisect start
    # bad: [e38970b3100deecfdbc0ec183c527b49a6e68157] Don't auto-register types by default. Resolves #27.
    git bisect bad e38970b3100deecfdbc0ec183c527b49a6e68157
    # good: [dcb6a346e9130e736f45f65761ee57fd337483d7] Bit of tidying up.
    git bisect good dcb6a346e9130e736f45f65761ee57fd337483d7
    # good: [89f7bc018b5fc34c01bea545e3641ee2c77241ac] Bump version
    git bisect good 89f7bc018b5fc34c01bea545e3641ee2c77241ac
    # bad: [c08ed22ef9ac9cc66c56562b01143333fd61beae] Builders for conventions by name and by scan.
    git bisect bad c08ed22ef9ac9cc66c56562b01143333fd61beae
    # bad: [3fbc17dc37c35f963c5cea22814408ceac61787f] Bump version: release 0.2.0.
    git bisect bad 3fbc17dc37c35f963c5cea22814408ceac61787f
    # good: [e60f5d82b16e7b6ae739fa21cb1fc6c224d11c1a] Add link to documentation
    git bisect good e60f5d82b16e7b6ae739fa21cb1fc6c224d11c1a
    # good: [052e765169b71e691c70b7f458593f5552c75d41] Add resolution for arrays.
    git bisect good 052e765169b71e691c70b7f458593f5552c75d41
    # bad: [164f5061d3f54ab5cba9d5d14ac04c71d4690a71] Move some test fixtures about for consistency.
    git bisect bad 164f5061d3f54ab5cba9d5d14ac04c71d4690a71
    # first bad commit: [164f5061d3f54ab5cba9d5d14ac04c71d4690a71] Move some test fixtures about for consistency.

    Use git bisect visualize to show your bisect progress in a GUI tool:

    $ git bisect visualize

    If you can’t tell whether a revision is bad or good (for example, because it won’t compile), use git bisect skip:

    $ git bisect skip

    On a final note, you don’t need to worry if you haven’t been meticulous about using git rebase to keep your source history linear. git bisect is smart enough to handle branches.

    All in all, git bisect is a really useful tool. It allows you to zoom in on bugs in your source code very quickly even in large repositories with extensive histories. Using it is a skill that I would heartily recommend for every developer and tester’s toolbox.

  • On the “reproducibility crisis” in science

    I’ve had two or three people tell me about the “reproducibility crisis” in science in the past few months. The most recent such comment was at the weekend, which coincidentally came right at the time when a 2016 Nature article on the subject was at the top of Hacker News. Here are some thoughts on the matter.

    First of all, I’d like to make it clear that the reproducibility crisis doesn’t call the entire scientific method into question right across the board. There may be a lot of papers published in the scientific literature that can’t be replicated, but there are also vast swathes of others that can and are — often by multiple independent methods. The fact that some studies can’t be reproduced says nothing whatsoever about the validity of the ones that can, and it’s the ones that can that go on to establish the scientific consensus and make their way into school and university textbooks.

    In fact, it’s only to be expected that the scientific literature would contain a sizeable proportion — perhaps even a majority — of non-reproducible studies. Scientists are only human, and if they rarely if ever made any mistakes, then that would suggest there was some form of underhanded collusion going on. It’s all too easy for them to inadvertently end up making mistakes, taking shortcuts, or writing down lab notes that don’t accurately describe exactly what they did. But that is why science demands reproducibility in the first place — to filter out problems such as these.

    It’s important to realise that the reproducibility crisis only really affects the very frontiers of science — cutting edge research where the practices and protocols are often still being developed. There will always be a certain amount of churn in areas such as these. It rarely if ever affects more well established results, and it’s not even remotely realistic to expect it to cast any doubt on the core fundamentals. We can be absolutely confident that subjects such as relativity, quantum mechanics, Maxwell’s Equations, thermodynamics, the Periodic Table, evolution, radiometric dating, Big Bang cosmology and so on are here to stay.

    Furthermore, scientists are actively working on ways to improve things. There is a whole scientific discipline called “meta-science,” which is devoted to increasing quality while reducing waste in scientific research. That is why scientists have adopted techniques such as peer review, blind studies, statistical methods to detect fraud (using techniques such as Benford’s Law) and the like. One recent innovation has been pre-registration of clinical trials as a means to combat publication bias and selective reporting: in many cases, the studies are peer reviewed before the results are taken rather than after the fact.

    Interestingly, the disciplines that are most profoundly affected by the “reproducibility crisis” are the social sciences — sociology, psychology, medicine, and so on. These are subjects which first and foremost concern the vagaries of humans and other living beings, which deal with very imprecise data sets with wide spreads of results, and which predominantly rely on statistics and correlations that are much more open to interpretation and studies that are qualitative rather than quantitative in nature. It is less of a problem for the more exact sciences, such as physics, chemistry, mathematics, geology, astronomy, or computer science.

    The thing about science is that its foundations of testability and rigorous fact-checking tend to bring it into direct conflict with dishonest people, hidden agendas, and vested commercial or political interests. Consequently there is no shortage of people who will do whatever they can to try and undermine public trust in the scientific community and even the scientific method itself. One of the ways that they do so is to take real or perceived imperfections and shortcomings in science, blow them out of all proportion, and make them appear far more significant and far more damaging to the legitimacy of scientific scrutiny than they really are. But that’s just dishonest. Science may not be perfect, and non-reproducible papers may be plentiful, but nobody gets a free pass to reject anything and everything about science that they don’t like.

    Featured image: United States Air Force Academy

  • How not to stop Brexit

    How not to stop Brexit

    For better or for worse, the Conservatives under Boris Johnson have won the General Election with a majority of either 78 or 80, depending on which way the result in St Ives turns out. This means that, for better or for worse, Brexit is definitely going ahead, and there will not be a second referendum.

    I personally voted Remain in 2016. Leaving the EU didn’t make much sense to me from either an economic or a logistical perspective, and I was particularly unimpressed with the arguments I was seeing from the “Leave” side, many of which seemed anti-intellectual, tin-foil hat conspiratorial, or simply not true. And I’ve never been impressed with the incessant references to the referendum result as “The Will Of The People.” The 48.1% of us who voted Remain are people too.

    But Brexiteers have one legitimate concern that I have to agree with. The EU has a problem with taking “no” for an answer.

    I’ve seen this playing out time and time again for over a quarter of a century. We saw it, for example, with the Maastricht Treaty and with the Lisbon Treaty (which was just a rebranding of the EU Constitution). Whenever an EU member state has a referendum that gives a result that Brussels doesn’t like, they simply make them vote again until they come up with the “right” result.

    This isn’t democracy: it’s democracy theatre. It’s a complete sham, and if truth be told it makes the idea of a so-called “People’s Vote” seem really, really creepy, because it would just be more of the same. It’s a toxic, anti-democratic practice that needs to be broken.

    Nevertheless, the 2016 referendum could potentially have been undone if only Remainers had gone about it the right way. If the UK were to leave the EU wth some kind of interim arrangement in place, and then have a “rejoin” referendum some months later, that would respect the mandate from 2016, avoid the mathematical problems with having three options on the ballot paper (deal/no deal/remain) rather than two, and generally have a much more credible claim towards being truly democratic. It would be clean, fair and above board.

    Unfortunately, no political party proposed this option. Instead, far too many politicians did everything that they could to try to undermine and frustrate the referendum result before it could be carried out. In fighting tooth and nail for approaches that were not democratically credible, Remainers failed to come up with one that was. And in so doing, they made the whole process far, far, far more chaotic, stressful and acrimonious than it could otherwise have been.

    Featured image credit: Tim Reckmann

  • Sorry, but I won’t watch your video

    From time to time, when I’m discussing or debating something online, people send me links to videos — usually on YouTube — that they expect me to watch in support of whatever point they’re arguing.

    Nowadays, I usually decline. I’m always open to a well-reasoned argument, even if I disagree with it. But it needs to be presented in a format where I can engage with it properly, fact-check it easily, and make sure I have understood it correctly. The video format doesn’t do that, and in fact more often than not it gets in the way.

    • Videos are inefficient. I can read far more quickly than I can watch a video. When I am reading, I can also skip over content that is already familiar to me, or that isn’t relevant to the topic at hand.
    • Videos are not searchable. With written material, especially online, I can quickly copy and paste words or phrases into Google to fact-check it, or into a forum post to reply to you or ask about it elsewhere. I can’t easily do this with videos.
    • Videos spoon-feed you. When reading, I can step back and ask questions. If there’s something I haven’t understood, I can re-read it several times to make sure that I get it. By contrast, with videos, the videographer sets the pace, and you have to fight against that if you want to do any critical thinking. Sure, you can pause and rewind, but doing so is much more inefficient and imprecise than with written text.
    • Videos are soporific. I’ve lost count of the number of times that I’ve momentarily fallen asleep watching a video and had to rewind it because I’ve missed an important point. Or gotten distracted onto something else and lost track of what was being said. By contrast, when I’m reading, my mind is totally focused on the text.
    • Videos are often far too long. Sorry, but if your video is an hour long, then I can tell from that fact alone that either it is a Gish Gallop, or it takes far too long to get to the point, or it is trying to tackle a subject that is too complicated to address properly in video format anyway.

    Videos have their place, and the points that they make may well be valid and correct. But they are best suited for entertainment or inspiration. They are less effective for education or information, and are simply not appropriate for online debate and discussion. If someone asks you to watch a video, ask them to provide you with a text-based alternative — a web page, a PDF or a PowerPoint presentation — instead. If they really don’t have any alternative other than a video, ask them to summarise it and provide timestamps. Your time is valuable. Don’t let other people dictate how you spend it.

    Featured image credit: Vidmir Raic from Pixabay

  • The vagaries of humans and other living beings

    The title of this post is a quote from my school report when I was thirteen years old. My headmaster wrote about me, “His mind is better attuned to exact subjects such as Maths and Physics than to those concerning the vagaries of humans and other living beings.”

    It was a fair point. I was a pretty geeky kid when I was at school. I excelled in subjects such as maths and physics, I did reasonably well at most other academic subjects — and I was utterly hopeless on the rugby pitch. But his comment highlighted something that’s worth bearing in mind whenever discussing subjects such as science and technology. There are two kinds of subjects that we get taught in school or at university, and that we deal with in the workplace. On the one hand, there are exact subjects, such as maths, physics, chemistry, geology, electronics, computing, and the like, while on the other hand, there are those that deal with the vagaries of humans and other living beings. And the two require completely different mindsets.

    It’s a difference that I’ve felt keenly since I reactivated my Facebook account back in June after a two and a half year break. About a couple of months in, I wrote a post that simply said this:

    Passion is not a substitute for competence.

    This statement would be totally uncontroversial if I posted it on one of our Slack channels at work. When you’re working with exact subjects such as science or technology, you simply can’t afford to let passion become a substitute for competence. I’ve seen projects have to be rewritten from scratch and tech companies fail altogether because they made that mistake, especially about ten years ago when the whole “passionate programmer” hype was at its height.

    But many of my friends on Facebook are pastors. Their entire vocations are built around dealing with the vagaries of humans and other living beings. Competence to people such as them may still be necessary, but the relative importance that they can (and should) place on passion of one form or another is much, much greater. To them, saying that “passion is not a substitute for competence” has completely different connotations.

    Needless to say, my short, seven-word post turned out to be pretty controversial. And that controversy took me completely by surprise.

    The essential difference

    Exact subjects deal in hard evidence, empirical data, and systems tightly constrained by reason and logic. They leave little or no room for opinion or subjective interpretation, apart from situations where there is insufficient data to differentiate between two or more alternatives. The arts and humanities, on the other hand, are much more open to interpretation, speculation, and subjective opinion. Exact subjects require precise definitions and literal thinking, often expressed through symbols and code. The arts and humanities are expressed in figures of speech, analogy, poetry, and terms that are often ambiguous and very loosely defined.

    Both are equally important. But they are not interchangeable.

    The mistake that all too many people make is to treat exact subjects in the way that they would treat the vagaries of humans and other living beings, or vice versa. For non-technical people, this is all that they know how to do. Learning to think in the exact, rigorous manner required by the sciences does not come easily to many people. It requires training, practice, discipline, experience, patience, and hard work. Subjects that concern the vagaries of humans and other living beings, on the other hand, only require intuition, empathy and common sense, and tend to be the “default” way of thinking for most people.

    This is why pseudoscience gets so much traction. Subjects such as astrology, cryptozoology, alternative medicine, water divining or graphology have a scientific looking veneer, but rather than adopting an exact, rigorous approach, they appeal to the vagaries of analogy, hand-waving approximation, empathy and “common sense,” which yield results that are much easier for most people to relate to. Unfortunately, since they are dealing with exact, deterministic systems, this approach is inappropriate, and therefore misleading or even simply wrong.

    It’s also common for non-technical people to view science as if it were a matter of subjective opinion. This is especially the case when the exact sciences produce results that they find awkward for political or economic reasons. I’ve lost count of the number of climate change sceptics who I’ve seen saying “Surely if something is science, it should allow for multiple opinions,” for example. Sorry, but it doesn’t work that way. If it did, then we could have referendums on the laws of physics. You can make all the noise you like about The Will Of The People™, but good luck trying to abolish Maxwell’s Equations or the Second Law of Thermodynamics just because 51.9% of the population voted to do so. And then who can forget this:

    “The laws of mathematics are very commendable, but the only law that applies in Australia is the law of Australia.” — Malcolm Turnbull, Prime Minister of Australia.

    Context switching

    But if some people make the mistake of viewing exact subjects as if they were subjective, human ones, there is an equal and opposite danger for those of us whose careers and expertise fall on the “exact” side of the table: to view the vagaries of humans and other living beings as if they were deterministic systems tightly constrained by reason and logic.

    When you’re giving instructions to a computer, it takes what you say at face value and does what you ask it to do. If it doesn’t “get it” the first time (your code doesn’t compile, your tests fail, or whatever) you just tweak your code, rephrase it, and repeat until you get the results you want. You can’t do that with people. They filter what you say through a layer of assumptions and preconceptions about you and through their own expertise. When I said that passion is not a substitute for competence, my pastor friends didn’t have software engineering or recruitment in mind, but activities such as street evangelism or politics.

    Nor can you keep rewording and refining your attempts to communicate your intentions or understanding to other people. If they’re genuinely interested, it might help, but much of the time they’ll either miss the point of what you’re saying, or else conclude that you’re just boring or even argumentative and obnoxious, and switch off.

    Herein lies another problem. For if it’s hard to learn to think in exact, rigorous terms, it’s even harder to switch context between the two. And the hardest skill of the lot is to be able to bridge the gap between them.

    Yet this is the very challenge that we face in software development teams. There is no subject more geared towards exact, rigorous, pedantic thinking than computer programming. If you get things wrong, Visual Studio lets you know it in no uncertain terms — in some cases dozens of times an hour. You are subjected to a feedback loop that makes working in a physics or chemistry lab look positively lethargic by comparison. You have to worry about spelling, capitalisation, and even tabs versus spaces. Yet at the same time, you are frequently being fed requirements from non-technical stakeholders that are vague, ambiguous, incoherent, self-contradictory, or even patent nonsense. As Martin Fowler said in his book, Patterns of Enterprise Application Architecture (and as I’ve quoted in the strapline of my blog), “there are few things that are less logical than business logic.”

    Be aware of what you’re dealing with.

    If there’s one thing I’ve learned over the summer, it’s the need to have some empathy for how “the other side” thinks. I don’t think it’s right to expect non-geeks to develop exact, rigorous approaches to anything, but just to be aware that there are times when such approaches are needed, and not to denigrate or disparage those of us who work with them. But those of us of a more technical mindset need to be able to relate to both worlds. This being the case, the burden should be on us to bridge the gap as best we can.

    Featured image: March for Science, Melbourne, April 22, 2017. Photograph by John Englart.

  • No matter what your preferred software architecture is — whether it’s n-tier, CQRS, Clean Architecture or whatever — if you’re a .NET developer, you need to watch this video. No exceptions, no excuses. It’s by Udi Dahan, one of the “founding fathers” of CQRS. He makes exactly the same points as I’ve been making about software architecture over the past few years: