Laurence Diver combines insight from legal theory, philosophy of technology and programming practice to develop a new theoretical and practical approach to the design of legitimate software. The book critically engages with the rule(s) of code, arguing that, like laws, these should exhibit certain formal characteristics if they are to be acceptable in a democracy. The resulting digisprudential affordances translate ideas of legitimacy from legal philosophy into the world of code design, to be realised through the 'constitutional' role played by programming languages, integrated development environments (IDEs), and agile development practice. The text interweaves theory and practice throughout, including many insights into real-world technologies, as well as case studies on blockchain applications and the Internet of Things (IoT).Whenever you use a smartphone, website, or IoT device, your behaviour is determined to a great extent by a designer. Their software code defines from the outset what is possible, with very little scope to interpret the meaning of those 'rules' or to contest them. How can this kind of control be acceptable in a democracy? If we expect legislators to respect values of legitimacy when they create the legal rules that govern our lives, shouldn't we expect the same from the designers whose code has a much more direct rule over us?