Skip to content
CONTACT
Home

Murphy's Laws

If something can go wrong in IT, it already has, and somebody has given it a name. Here are the laws, with the author when we know who it was and a comment when it simply couldn't be helped.

No laws were harmed during the collection. Some of them rebooted on their own.

Classic laws

Programming and bugs

Flon's Axiom There does not now, nor will there ever, exist a programming language in which it is the least bit hard to write bad programs. Lawrence Flon Greenspun's tenth rule Any sufficiently complicated C or Fortran program contains an ad hoc, slow, bug-ridden implementation of half of Common Lisp. Philip Greenspun Law of the two problems Some people, when confronted with a problem, think: 'I know, I'll use regular expressions.' Now they have two problems. Jamie Zawinski Law of the evolved bug Any sufficiently advanced bug is indistinguishable from a feature. Anonymous Law of the punctual bug The critical bug is discovered ten minutes after release, never ten minutes before. Anonymous Law of the treacherous calendar Any program that handles dates will work all year round, except on 29 February, on the night the clocks change and on the first day of January. Anonymous Law of adopted code Code copied from the Internet works perfectly until you try to understand why it works. Anonymous Law of the miracle-working colleague The bug that has been tormenting you for hours vanishes the instant you call a colleague over to look at it, and reappears as soon as they go back to their desk. Anonymous Law of the lying comment When the comment and the code disagree, both are probably wrong. Anonymous Law of 'it compiles, so it works' If the code compiles without errors, the tired programmer will consider it ready for delivery. Anonymous Law of the test data The most embarrassing test data entered during development will, sooner or later, appear in front of the most important client. Anonymous Law of the oracular message The more serious an error is, the vaguer, more generic and more incomprehensible the message announcing it. Anonymous Law of 'it works on my machine' Any error reported by the client is impossible to reproduce on the programmer's computer, where everything works perfectly. Anonymous Law of Friday afternoon A change put into production on Friday afternoon will break after six in the evening, when all your colleagues are already on the motorway. Anonymous Law of the prolific fix Every bug fixed in a hurry generates at least two new ones, preferably in a part of the program that had nothing to do with it. Anonymous Law of posthumous documentation Documentation, when it exists, describes the previous version of the program with great precision. Anonymous Law of the untested part The part of the program that breaks in production is always the one nobody thought of testing, because it was too simple to get wrong. Anonymous Law of the innocent line The bug is always in the last line you check, and it is the one you were absolutely sure was correct. Anonymous The law of leaky abstractions All non-trivial abstractions, to some degree, leak the details they were supposed to hide. Joel Spolsky Law of the two hard things There are only two really hard problems in computer science: cache invalidation and naming things. Phil Karlton The Law of Demeter An object should only talk to its immediate neighbours and not to strangers: no chains of calls running across half the program. Ian Holland Eagleson's Law Any code of your own that you haven't looked at for six or more months might as well have been written by someone else. Anonymous Hyrum's Law With a sufficient number of users, every observable behaviour of your system will be depended on by somebody, regardless of what you promised in the documentation. Hyrum Wright Kernighan's Law Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian Kernighan Linus's Law Given enough eyeballs, all bugs are shallow. Eric S. Raymond Lubarsky's Law of Cybernetic Entomology There's always one more bug. Anonymous Osborn's Law Variables won't; constants aren't. Anonymous Wadler's Law In designing a language, the time spent discussing a feature grows as you move from semantics to syntax, then to lexical syntax, down to comments, which beat everything. Philip Wadler Lehman's Laws Software used in the real world must change continually or it becomes progressively less useful; and every change increases its complexity, unless someone works specifically to reduce it. Meir M. Lehman Premature optimisation Premature optimisation is the root of all evil (or nearly) in programming: first make it work, then measure where it is slow. Donald Knuth Hoare's principle There are two ways of constructing a software design: make it so simple that there are obviously no deficiencies, or so complicated that there are no obvious deficiencies. The first method is far more difficult. C. A. R. Hoare The Pareto principle (80/20) In many phenomena about 80% of the effects come from 20% of the causes: for example, 80% of the problems come from a small fraction of the bugs or the customers. Vilfredo Pareto, generalised by Joseph M. Juran The ninety-ninety rule The first 90% of the code accounts for the first 90% of the development time. The remaining 10% accounts for the other 90%. Tom Cargill Pike's rules You can't tell in advance where a program will spend its time: measure first. Fancy algorithms are slow when n is small, and it is the data, more than the code, that dictates the right structure. Rob Pike

Projects and people

Corollary of the important audience The higher the rank of the person watching the demonstration, the more likely the demonstration is to fail. Anonymous Law of the clairvoyant client The client knows exactly what they want at the precise moment you deliver what they asked for. Anonymous Law of the pi multiplier To get the real duration of a software project, take the programmer's estimate and multiply it by pi. If the project is important, use the decimal places too. Anonymous Law of the eternal temporary fix In software, nothing is more permanent than a temporary solution. Anonymous Law of the phantom requirement The most important requirement of the project is communicated verbally, in passing, on delivery day. Anonymous Parkinson's law of triviality An organisation gives time to decisions in inverse proportion to their importance: little is said about the reactor and a great deal about the bike shed. C. Northcote Parkinson Law of the demo in front of the client A program that has worked in a hundred trials fails on the hundred and first: the one in front of the client. Anonymous Law of the recursive meeting Every complex technical problem generates a meeting, which generates a preparatory meeting, which generates the need for a meeting to decide when to hold the meeting. Anonymous Law of the sworn estimate Any estimate given verbally, with a thousand caveats and three 'maybes', will become a deadline written in the boss's calendar. Anonymous Brooks's Law Adding people to a late software project makes it later. Fred Brooks Campbell's Law The more a quantitative indicator is used for important decisions, the more it is corrupted, and the more it distorts the processes it was meant to monitor. Donald T. Campbell Conway's Law An organisation that designs a system will end up producing a system that copies its own communication structure. Melvin Conway Gall's Law A complex system that works has always evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. John Gall Goodhart's Law When a measure becomes a target, it ceases to be a good measure. Charles Goodhart Hofstadter's Law It always takes longer than you expect, even when you take into account Hofstadter's Law. Douglas Hofstadter Parkinson's Law Work expands so as to fill the time available for its completion. Computing adds a corollary: data expands to fill all the space available. Cyril Northcote Parkinson Sayre's Law In any dispute, the intensity of feeling is inversely proportional to the value of the issues at stake. Wallace Sayre Weinberg's Law If builders built buildings the way programmers write programs, the first woodpecker that came along would destroy civilisation. Gerald Weinberg Wiio's laws Communication usually fails, except by accident. And if it seems to have succeeded as intended, there is certainly a misunderstanding. Osmo Antero Wiio The Dilbert principle Companies tend to promote their least competent employees into management, to limit the damage they can do to the real work. Scott Adams The Peter Principle In a hierarchy every employee tends to be promoted until they reach their level of incompetence, and there they stay. Laurence J. Peter (with Raymond Hull)

Hardware and printers

Law of the short cable Every cable is always ten centimetres shorter than the distance it needs to cover. Anonymous Law of the missing cable In a drawer containing fifty different cables, the one you need right now is never there. Anonymous Law of the missing driver After reinstalling the system, the only driver missing is the one for the network card, which you'd need to download all the other drivers. Anonymous Law of the hostile projector The meeting room projector has a different input from your laptop, and the right adapter is the only one nobody brought. Anonymous Law of the clairvoyant toner Toner and paper always run out halfway through the most important document of the week, never during the test prints. Anonymous Law of the selective paper jam Paper only jams on the one sheet you can't reprint: the letterhead, the pre-printed form, the last good sheet. Anonymous Law of the optimistic battery The battery indicator lies: twenty per cent lasts two hours if you don't need it and thirty seconds if you're in the middle of something important. Anonymous Law of the quantum USB stick A USB plug always goes in on the third attempt: the first time it's upside down, the second time too, and the third time it was the right way round all along. Anonymous Law of the expired warranty A device breaks down the day after the warranty expires, except when it breaks down the day before and you've lost the receipt. Anonymous Law of the phantom network printer The confidential document you send to print always ends up on the printer on the other floor, in front of the wrong person. Anonymous Law of the impatient printer The probability that the printer will jam is directly proportional to how much of a hurry the person printing is in. Anonymous Law of the runaway screw The screw that slips through your fingers while you're opening the computer always falls into the most unreachable spot in the case. Anonymous Amdahl's Law Adding processors to a job speeds up only the part that can be divided: the part that must run in sequence sets a limit that no hardware can exceed. Gene Amdahl Grosch's Law A computer's performance grows with the square of its price: spend twice as much and you get a machine four times as powerful. Herb Grosch Gustafson's Law With more processors you don't solve the same problem faster: you solve a bigger problem in the same time. So parallel computing pays off more than Amdahl predicts. John L. Gustafson Koomey's Law The number of computations a computer performs per unit of energy consumed doubles at regular intervals: roughly every eighteen months for decades, more slowly after 2000. Jonathan Koomey Moore's Law The number of transistors that can be crammed onto a chip doubles at regular intervals: at first every year, then, after an adjustment, roughly every two years. Gordon Moore Rock's Law The cost of a semiconductor fabrication plant doubles roughly every four years. Also known as Moore's second law. Arthur Rock

Networks and the Internet

The Streisand effect Trying to hide, remove or censor a piece of information online ends up making it far more visible and widespread. Mike Masnick Betteridge's law of headlines Any headline that ends in a question mark can be answered by the word 'no'. Ian Betteridge Law of the spiteful Wi-Fi The Wi-Fi works perfectly in every room of the house except the one you're in. Anonymous Law of the download at 99% A download or upload always fails at ninety-nine per cent, never at one. Anonymous Law of the router reboot Before calling support, nobody reboots the router; after calling, the problem is solved by rebooting the router. Anonymous Law of the website that works everywhere The website works on every computer in the office except the one belonging to the client who has to approve it. Anonymous Law of the crucial video call The connection holds up through hours of cat videos, but drops exactly when it's your turn to speak in the important video call. Anonymous Brandolini's Law The amount of energy needed to refute nonsense is an order of magnitude bigger than that needed to produce it. Alberto Brandolini Cunningham's Law The best way to get the right answer on the Internet is not to ask a question; it's to post the wrong answer. Steven McGeady Godwin's Law As an online discussion grows longer, the probability of someone making a comparison involving Hitler or the Nazis approaches certainty. Mike Godwin Metcalfe's Law The value of a network grows with the square of the number of connected devices (or people): every new node increases the possible connections of all the others. Robert Metcalfe Nielsen's Law of bandwidth A high-end user's connection speed grows by about 50% a year: more slowly than computing power. Jakob Nielsen Poe's Law Without a clear indication of the author's intent, a parody of an extreme view is indistinguishable from a sincere expression of that view. Nathan Poe Skitt's Law Any post correcting someone else's error will almost certainly contain at least one error of its own. Anonymous (pseudonym 'Skitt') The robustness principle Be conservative in what you send and liberal in what you accept from others. Jon Postel

Users and support

Law of the Friday night failure Serious faults only occur when the technician isn't around: on Friday evening, on the August bank holiday or on the first day of the holidays. Anonymous Law of the unread error message The user closes the error message before reading it, then calls the technician to find out what it said. Anonymous Law of ‘I didn't touch anything’ The user who says ‘I didn't touch anything’ touched something; the only unknown is what. Anonymous Law of the relative who knows about computers Whoever in the family ‘knows about computers’ will spend every holiday lunch setting up an uncle's printer. Anonymous Law of the healing technician The problem disappears at the exact moment the technician arrives, and reappears as soon as they leave. Anonymous Law of the forgotten password A password is always forgotten the day after you changed it, because the system made you. Anonymous Law of the never-good-enough password The website rejects every password until it becomes impossible to remember, and then rejects that one too because it contains a character that isn't allowed. Anonymous Law of the unplugged plug Before anyone checks whether it's plugged in, a virus, a motherboard failure and a conspiracy will already have been suspected. Anonymous Fitts's Law The time needed to reach a target with a movement depends on its distance and size: the further away and smaller it is, the longer it takes and the more often you miss. Paul Fitts Hick's Law The time needed to make a decision increases with the number of available options (logarithmically, not linearly). William Edmund Hick (and Ray Hyman) Jakob's Law Users spend most of their time on other websites, so they expect yours to work the same way as the ones they already know. Jakob Nielsen Tesler's Law Every application has an amount of complexity that cannot be removed: you can only decide whether the programmer or the user has to deal with it. Larry Tesler Gilb's Laws of Unreliability Computers are unreliable, but humans are even more unreliable; and any system that depends on human reliability is unreliable. Tom Gilb Hanlon's razor Never attribute to malice that which is adequately explained by carelessness or incompetence. Robert J. Hanlon The Doherty threshold Productivity rises sharply when the computer responds to the user in less than about 400 milliseconds: below that threshold, neither one is waiting for the other. Walter J. Doherty and Arvind J. Thadhani

Data and backups

Technology and the future

Corollary of the three seconds Code that artificial intelligence writes in three seconds takes three days to understand and a week to fix. Silvano De Poli Corollary of the solemn prompt Writing 'without errors' in a request to an artificial intelligence does not eliminate errors: it merely makes them more polite. Silvano De Poli Corollary of the rest unchanged When artificial intelligence hands you the 'complete code', the part you needed has been replaced by a comment saying 'rest of the code unchanged'. Silvano De Poli Corollary of the imaginary function When you ask an artificial intelligence for help, the most elegant solution it offers will use a function that does not exist. Silvano De Poli Corollary of the forgotten rule In a long conversation with an artificial intelligence, the first instruction to be forgotten is the one you had declared fundamental. Silvano De Poli Corollary of artificial apologies When you point out an error to an artificial intelligence, it will apologise with great sincerity and give it back to you identical, with better formatting. Silvano De Poli Law of the new computer The computer you've just bought has already been overtaken by the model released while you were driving home, which is cheaper too. Anonymous Law of the update that breaks things Every update that fixes one problem introduces at least one new one, usually in something that used to work perfectly. Anonymous Law of the inconvenient update The computer always decides to install updates when you need to switch it off and dash, or switch it on and present. Anonymous Amara's Law We tend to overestimate the effect of a technology in the short run and underestimate it in the long run. Roy Amara Atwood's Law Any application that can be written in JavaScript will eventually be written in JavaScript. Jeff Atwood Bell's Law of computer classes Roughly every decade a new class of computer is born, smaller and cheaper, creating a new market and a new way of using computers. Gordon Bell Sturgeon's Law Ninety per cent of everything is rubbish: it applies to science fiction, but also to books, films, programs and products of every kind. Theodore Sturgeon Wirth's Law Software gets slower faster than hardware gets faster. Niklaus Wirth Zawinski's Law Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can. Jamie Zawinski The Jevons paradox When technology makes the use of a resource more efficient, total consumption of that resource often rises rather than falls, because using it becomes more worthwhile. William Stanley Jevons Clarke's third law Any sufficiently advanced technology is indistinguishable from magic. Arthur C. Clarke