Why Writing Contracts Is Like Writing Code

Wed 07 Dec 2022

Lawyers and programmers. Not many would argue these two job titles have much in common. In fact, the internet is pretty full of anecdotes saying lawyers don't understand technology or how to code. Well, at Clocktimizer, we know there area lot of tech savvy lawyers, but we also think that there's a lot of similarities between drafting a contract, and drafting code. In this blog we'll be looking at some of the ways contract definitions, and the lexicon of programming languages overlap. From the importance of precision, to why we all need to avoid infinite loops! For a more in depth look at the similarities between the fundamental structure of contracts and code, we hope this blog can help.

The importance of definitions

If you've ever read through a contract you know that the first page or so is devoted to definitions. It's a fairly self explanatory step to create an understanding about specific terms. Better still, it avoids a lot of legal battles later as parties argue over whether or not the 'car' left to them by their Great Aunt Jane was the priceless Mustang or the Ford Fiesta. In law, these defined terms allow the rest of the contract to remain shorter and more readable. What many may not realize, is that this is very similar to the way a programming language works. Many programming languages, like Python or Ruby, use libraries to define specific actions ('statements'). These actions are often represented by a single word, which have been agreed upon in advance by the developers of the programming language. What they mean in practice, is that programmers can use a single word to dictate an action rather than writing out whole sentences in code. So, say a programmer wants to calculate the total cost of a 30-year mortgage with 5% interest. Instead of typing out the whole equation, they can simply type: calculate_total_mortgage_amount(30, 0.05). While this is a simple example, it is clear that there are parallels with contract drafting. In both, the point of definitions is to reduce the length of the document or code. Equally, it reduces uncertainty. In both cases, defining the terms, leads to a defined outcome.

Avoiding infinite loops

An infinite loop is a programming term, meaning a piece of code that lacks a functional exit. Often code will require the computer to change a piece of data. Following that change, a condition is checked. In many cases this could be whether a counter has reached a certain number. If this is not the case, the loop requires the computer to repeat the task, until the task times out (if a time is set) or until the computer runs out of memory and crashes. An infinite loop would then arise where the specific condition cannot be ascertained. While many lawyers may not be aware of infinite loops, they may have also fallen prey to them in defining the contract's terms. Eagle eyed readers may be able to spot the infinite loop in the following definition:

"Accounts Payable" means supplier invoices, reimbursements, expense payments and other line items that would typically fall within the scope of Accounts Payable;

Using the term you are defining, to define the term you are defining (whew - that was a tongue twister!) is the legal equivalent of an infinite loop. Both lawyers and programmers have to use precise definitions to avoid poor outcomes. Often, this involves both having to think about the desired outcome carefully, before committing those ideas to paper.

The sin of poor syntax

Every programmer will be painfully familiar with the error message. Errors in compiled code can arise from a myriad of syntax-based reasons. From a missing comma to a misspelled statement. The result is the same, however. The computer cannot 'read' and understand the code properly, and so the actions cannot be completed as desired. Syntax is equally important for lawyers in creating contract definitions. Contracts use capital letters to signify a defined term. It makes them easy to distinguish from undefined terms. Thus, a failure to use a capital letter can result in confusion for the contracting parties later. A common example is the word 'party'. 'Party' as defined in a contract refers to a specific person or persons (or even companies). However there can also be additional parties separate from the defined 'Party' referred to in the contract. A failure to use the capital letter in the right place, can result in a contract with an unintended outcome. For both lawyers, and programmers, syntax is essential. There is significant overlap between the way contract law and programming languages approach the function of language in both their fields. Language must be clearly defined to avoid confusion and reduce repetition. Lawyers and programmers must pay special attention to the way they define terms to achieve outcomes. Finally, both must pay close attention to syntax to create certainty for computers and contracting parties alike. 



Discover the Latest Enhancements in Litera Drafting: Q2 2024 Update

Litera is thrilled to announce the latest updates to the Litera Drafting suite, designed to elevate your user experience. Our dedicated team...

What’s In Your Timecards

7 Ways to Leverage Actionable Data from Law Firm Time Entry Narratives. Is your law firm sitting on a goldmine of untapped data? While...

Leveraging Data Analytics and Reports for Law Firm Excellence

Law firms are increasingly turning to data analytics to optimize their operations and ensure adherence to stringent legal and ethical...

Ready to get started?

Join over 4,000+ firms already growing with Litera.