Image for post
Image for post

How studying law helped me with programming

When I decided to learn to code, I didn’t expect there to be anything other than work ethic that would be transferable from my law degree.

Time spent working in a previous industry is hard to ignore. You’ve put a lot of hours into understanding and getting better at it. People find it difficult to make decisions without taking that into account.

I wanted to write about the parts of my humanities degree that have really come in useful while I’ve been working as a developer.

It taught me:

As a law student I had to read case reports which ran to hundreds pages. I had to work from largely incomprehensible land law statutes and try to apply them to the facts in front of me. My friends on more essay based courses would get a list of books to read in a week and have to come up with an essay to show for it.

Tasks like these taught me how to read quickly and work out which parts of a document are important to whatever it is I was trying to achieve.

When I’ve worked on a project with an existing code base, it’s these skills that help me work out what’s relevant among hundreds of lines of code.

It’s also been really useful for understanding the documentation (instructions) for tools created by others and then applying that to the code I’m working on.

Ambiguities in law are what makes legal cases; a misplaced comma in a contract can be challenged to create a completely different outcome. That same misplaced comma will crash the app I’ve written.

Studying law taught me to pay attention to the details. Whether looking at a contract or code, that helps you recognise what looks right but also where to look for what’s wrong.

It’s crucial to give useful names to things in your code. The names need to describe what the code does so that someone else reading it can understand what’s happening (or even for when you read the code again a couple of weeks later and can’t remember).

When writing essays, I would think a lot about whether any given word accurately conveyed the meaning I wanted it to. I’ve found it easier to come up with names for things in my code as a result of doing a degree that’s based on the intention of words.

When I was writing for my degree, I found that structuring points in a logical way makes for a much better piece of writing. When the points are ordered so that they build up your argument, your reader can follow its progression.

I learnt to recognise when something felt like it was in the wrong place.

It’s exactly the same when I’m writing code. Depending on the language you’re using, things will either be hard to follow if they’re not in a logical order or the code just won’t work.

The law is made up of interlinking statutes (written out laws passed by parliament) and judgements (as English law is based on the precedent passed down from previous judgements).

Part of a statute might be updated by a tacked on phrase in a new, unrelated one. They can be in updated in a way that completely changes the result of cases on that subject going forwards. A new judgement can have the same impact.

This happens all the time in programming too. You’ll be using something that someone else has written and then they’ll create an update which if applied will mean you have to rewrite what you did before.

In both situations it’s great when something is updated for the better. I found it really useful that I already had experience working with things that changed regularly.

As it turned out, there are a whole lot of things that it taught me which were directly applicable to programming.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMI family. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!

Image for post
Image for post

Founder at Personably. Cambridge law grad not doing law. Learnt to code at Founders and Coders. Fullstack developer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store