2

First Principles Thinking for Software Engineers

 1 year ago
source link: https://addyosmani.com/blog/first-principles-thinking-software-engineers/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

First Principles Thinking for Software Engineers

December 4, 2022

First principles thinking can be helpful for solving complex problems because it allows you to break down a problem into its core elements and then systematically build up a solution from there. This can be a more effective approach than trying to solve a problem using preconceived notions or by making assumptions about the problem based on your past experiences.

first principles

It's used in computer science, engineering and physics, but there are also lessons that can be drawn from first principles thinking for any industry. In this article, I'll explain what first principles thinking is, why it's important and how to use it in your own life or business.

At a high-level, there are roughly four steps to applying first principles:

  1. Identify the problem you want to solve
  2. Break it down into the fundamental pieces
  3. Question and challenge your assumptions
  4. Create a new solution from the ground up

What Does 'First Principles' Mean?

A first principle is a starting point or assumption that you use to build your argument. First principles thinking refers to the process of breaking a problem down into its fundamental parts and working through each part in order until you reach an answer.

First principles thinking differs from other problem-solving techniques because it allows you to focus on the most important elements of the problem without getting distracted by extraneous details or secondhand information. By following this approach, you'll be able to reach solutions more quickly and confidently than if you skipped straight over certain steps of your reasoning process.

First principles thinking is a way of analyzing complex problems by looking at the root causes.

History of First Principles thinking

The concept of first principles has a long history in philosophy and science. It can be traced back to the ancient Greek philosopher Aristotle, who argued that all knowledge and understanding must be derived from first principles. In his writings, Aristotle emphasized the importance of starting with self-evident truths or axioms, and using logical reasoning to deduce more complex ideas.

The concept of first principles has continued to be influential in the development of modern scientific and philosophical thought. In the 17th and 18th centuries, philosophers such as René Descartes and Immanuel Kant also emphasized the importance of starting with first principles and using reason to deduce knowledge and understanding.

In the 20th century, physicist Richard Feynman popularized the use of the Feynman technique, which involves breaking down a concept or problem into its fundamental principles in order to better understand and solve it.

Step 1: Identify the problem you want to solve and break it down into the fundamental pieces

First Principles thinking starts with identifying the most important parts of a problem and then breaking them down into their component parts.

  • Identify the most important parts of your problem
  • Break each part down into its component parts, then identify how each part relates to the whole
  • Repeat this process until you've broken everything down as far as you can go

Step 2: Ask Why.

Once you've broken down the issue into its constituent parts, it's time to ask why. Asking why five times is a useful way of pinpointing the root cause of a given problem or outcome by getting at its source. When you ask "why?" each time and keep digging deeper and deeper, you can eventually get to the heart of any problem or outcome—even if it seems like there are multiple causes at play.

ask-why

To illustrate how this works, let's look at an example: You may feel like your team isn't working effectively because they're not communicating well with one another. However, after asking yourself why five times (and using your imagination), you might come up with something like this:

  • Why? We aren't communicating well because we haven't established clear expectations for what information needs to be shared across departments
  • Why? Because the company hasn't set up rigorous processes for sharing information across departments
  • Why? Because leaders may not know how important it is that employees share information freely within their departmental teams
  • on so on.

Step 3: Challenge your Assumptions

Assumptions are the foundation on which you build your solution. They can be either right or wrong, but they're always based on facts that you know to be true at this point in time. If your assumptions are correct, then they should lead you to a good solution; if they're incorrect, then they may cause issues later on down the line.

Assumptions can be categorized into three groups:

  • Market Assumptions (about the market itself)
  • Problem Assumptions (about the problem itself)
  • Solution Assumptions (about your proposed solution and its components)
  • People Assumption (about people involved in achieving success).

Step 4: Create a new solution from the ground up by focusing on your goal

The next step is to focus on your goal. The first step was to identify the problem, and the second step was to gather information about what needs to be done in order to solve it. Now is the time when you need to direct your focus toward the end result of solving that problem.

In practice this means:

  • Don't get distracted by details unless they're pertinent to solving your problem(s) and achieving your goals
  • Stay focused on achieving those goals and don't worry about what might happen along the way

Applying First Principles to Software projects

First principles thinking can help with software development in several ways. Some specific ways in which this approach can be beneficial include:

  • It helps to clarify the problem or challenge that the software is intended to solve, by breaking it down into its fundamental principles and identifying the key requirements and objectives.
  • It provides a basis for making informed design and development decisions, by using the identified principles to guide the selection of technologies, architectures, and design patterns.
  • It helps to identify and address gaps or inconsistencies in the understanding of the problem, by using the principles to evaluate the robustness and effectiveness of the solution.

Here are two examples of applying first principles thinking to the questions you can ask when developing products:

Designing a commerce application

Product questions:

  • Why does the user need this app? To quickly find and purchase an item because they need it.
  • Why do they need us to reduce the number of steps in the checkout process? They want to save time. One-click checkout may help.
  • Why do they need us to support reviews? This helps build trust in the items they are buying and can help them decide to purchase faster.

Engineering questions:

  • What are the minimum requirements for these features? A search box and a way to filter results and product pages, category pages and a way to checkout.
  • Which technologies can we use to build this? The commerce platform already has an API for searching, filtering and displaying results. Maybe a basic UI in CSS+JS on top of this is enough.
  • How do our users interact with each other? They can leave product reviews, which are visible to everyone in the system. We probably need to support creating/managing reviews.

Building a social network app: Questions

  • Why does the user need this app? A user wants to find other people with similar interests and then connect with them. They can search profiles, read public information about a person and leave comments on their profile.
  • Why do users need to interact with each other? They want to send messages or leave comments which are visible on their profile page.
  • What is our data model? Users have profiles, and they can add photos to their profile. How are we going to represent users in the system? A user will have a name, an email address (which we can use for messaging), as well as some other basic information like age or gender.

Downsides to thinking in first principles

Some of the downsides to thinking in first principles are that it can be hard to do, especially if we're not used to thinking that way. It also requires us to be open-minded and willing to invest time and energy into understanding the problem from all angles so we don't miss anything important.

It's time consuming - because we have to keep breaking down problems into smaller and smaller components until we reach their basic building blocks.

It can be difficult to know when to stop - if our goal is to find the most efficient way of doing something (such as making a car), then it may not matter if there are other ways of achieving that goal that would require less energy or fewer resources (perhaps some other manufacturer has figured out how to make cars more cheaply, but they just don't want us to know about it).

You find that one or more of your beliefs is not well-founded.

How first principles thinking fails is also worth reading

That said, these are not reasons to stop applying first principles thinking. They just mean that we have to be careful when applying it, and make sure that we don't let ourselves get carried away with our own ideas or assumptions.

Conclusion

First principles thinking is a powerful tool for tackling complex problems. This approach can help you think about the real root of a problem and avoid falling into the trap of thinking through analogy.

first principles thinking

You may find that other methods, such as the Socratic method, can compliment first principles thinking well. By considering the problem from multiple perspectives, you can gain a more comprehensive understanding of the problem and come up with solutions that are more creative and effective.

Here are some questions you might consider asking:

  • How do I know this is true?
  • What alternative viewpoints might exist?
  • How can I support my belief?
  • Why do I believe this to be true in the first place?

By asking these questions, you can get to the root of a problem and identify solutions that are both effective and sustainable.

If you would like to learn more about first principles, Farnham Street and Sahil Bloom have good write-ups.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK