Software code is built on rules, and the way it enforces them is analogous in certain ways to the philosophical notion of legalism, under which citizens are expected to follow legal rules without thinking too much. The ontological characteristics of code – its opacity, immutability, immediacy, pervasiveness, private production, and ‘ruleishness’ – amplify its ‘legalistic’ nature far beyond what could ever be imposed in the legal domain, however, raising significant questions about its legitimacy as a regulator. This contribution explores how we might critically engage with the text of code, rather than just the effects of its performance, in order to temper these extremes with the reflexive wisdom of legality. This means contrasting the technical performance of code with the social performativity of law, demonstrating the limits of viewing the latter as merely a regulative ‘modality’ that can be easily supplanted by code. The latter part of the article considers code and the processes and tools of its production from the perspective of legality, drawing on theories of textual interpretation, linguistics, and critical code studies. The goal is to consider to what extent it might be possible to guide that production, in order to ameliorate an ingrained ‘legalism’ that is democratically problematic.