HB Ad Slot
HB Mobile Ad Slot
Why Law Students Should Learn to Code in the Age of AI
Monday, January 26, 2026

For decades, the standard technical requirement for a law student was a mastery of Westlaw and a passing familiarity with Microsoft Word. However, as the digital architecture of society becomes increasingly complex, the "black box" approach to technology—where lawyers merely use tools provided to them—is becoming a liability. To truly understand the world they regulate, the modern lawyer must look under the hood.

Teaching law students to code in Python, rather than simply training them on pre-existing software packages, represents a fundamental shift in legal education. A handful of law schools, including my own (the Duquesne Kline School of Law), believe that teaching coding will equip students with the logical rigor, mathematical literacy, and understanding of digital architecture necessary to navigate a world governed by algorithms and encryption.

The Benefits of Becoming Creators, Rather than Consumers, of Legal Tech

When law students use pre-existing legal tech packages—software for e-discovery, contract analysis, or practice management—they are consumers of a finished product. They see the input and the output, but the logic in between remains a mystery. This creates a "black box" problem: lawyers cannot ethically or effectively challenge a process they do not understand.

By learning Python, students transition from consumers to creators. Python is uniquely suited for new coders without a STEM background due to its readable, high-level syntax that mirrors the structured logic of legal statutes.

Unlike using existing proprietary software to automate legal processes, building devices from scratch in Python requires students to understand both the law and the code that implements it. A lawyer who builds a legal app can be assured that the law upon which it is based is accurate. Increasingly, ethics boards will be asking about the now-uncertain question of when a machine practices law and what steps a reasonable lawyer must take to ensure that a legal app purchased from a vendor is correctly implementing the law for the jurisdiction in which it is being used. 

Lawyers who build apps themselves are in a position to say that, to the best of their ability and knowledge, the app was built on accurate applicable law. And the apps themselves are better tailored to their clients’ needs. Pre-packaged software is rigid. A lawyer who codes can build bespoke tools for niche practice areas, from environmental compliance monitoring to intellectual property tracking.

Preparing Students for Law in the Digital Age

The benefits of working with code extend beyond the ability to build devices. At Duquesne Kline, we offer an advanced class in Statistics and Machine Learning for Lawyers. In the era of Big Data, legal disputes increasingly turn on statistical significance. Whether it is a class-action discrimination suit or a complex antitrust case, lawyers must understand machine learning principles. By coding simple models in Python, students learn about "training data," "overfitting," and "algorithmic bias." This allows them to understand how a company’s automated hiring tool might inadvertently violate the Civil Rights Act—not just that it did, but how the math made it so.

Additionally, learning the basics of cryptography, by creating and implementing secure systems in Python, grounds the modern law student in the mathematical and computational complexities of cybersecurity and digital assets. Students in our introductory and advanced courses grasp how hashes, public-private key pairs, and blockchains function. Lawyers who understand the math behind a digital signature are better equipped to argue about the validity of a smart contract or the liability of a data breach. They come to understand that "code is law" in digital spaces, and to regulate those spaces, one must understand the math that enforces the rules.

The Disappearing Entry Barrier

A common critique of teaching law students to code is that the learning curve is too steep and the syntax too finicky. However, the rise of Generative AI (like ChatGPT, Gemini, and Claude) has fundamentally changed this dynamic.

Today’s law students don't need to spend weeks memorizing where every semicolon goes. They can use AI as a "pair programmer" to handle the precise syntax while they focus on the architectural logic. If students understand how a script should be structured—how the data should flow from a CSV file into a legal template—they can prompt an AI to generate the specific Python code.

This removes the barrier to entry. The student is no longer bogged down by the "grammar" of code; instead, they are the architect of the system. They focus on the high-level reasoning—the same skill they use when outlining a brief—while the AI handles the mechanical implementation. This synergy allows law students to reach a level of technical proficiency that was previously reserved for computer science majors.

Conclusion

Teaching law students to code in Python is not about turning every lawyer into a software engineer. It is about ensuring that the gatekeepers of justice are not illiterate in the language of the modern world.

Through the Law and Computing Concentration at Duquesne Kline, students are learning that the "logic" of the law and the "logic" of the computer are two sides of the same coin. By mastering Python, statistics, and the fundamentals of cryptography, they become better thinkers, more rigorous drafters, and more effective advocates. In a world where algorithms increasingly determine who gets a loan, who gets bail, and who gets a job, we cannot afford for lawyers to be mere users of software. They must be the ones who can read, write, and challenge the codes that govern our lives.

HB Mobile Ad Slot
HTML Embed Code
HB Ad Slot
HB Ad Slot
HB Mobile Ad Slot

More from The National Law Review's Guest Contributors - NLR

HB Ad Slot
HB Mobile Ad Slot
 
NLR Logo
We collaborate with the world's leading lawyers to deliver news tailored for you. Sign Up for any (or all) of our 25+ Newsletters.

 

Sign Up for any (or all) of our 25+ Newsletters