5 Ways First Principles Thinking Helps You Code Better

ArjanCodes · Beginner ·🛠️ AI Tools & Apps ·2y ago

Key Takeaways

The video discusses how first principles thinking can improve coding skills, covering topics such as problem-solving, software development, and design patterns, with tools like pipeline or workflow systems and large language models.

Full Transcript

today I want to talk about how first principle thinking is going to help you become a way better software developer what does that mean a first principle is a proposition assumption that you can't deduce from any other proposition or assumption that's from Wikipedia and it may sound a bit complicated but basically it means think like a scientist now you may think what does that have to do with software design and development actually quite a lot as I was thinking about this I realized that a lot of the things that learned over the past few years actually come down to more first principle thinking and applying that to the way that I design and develop software so today I'm going to cover five ways in which first principle thinking has helped me become a better software developer and once you're aware of these things they'll also help you improve your own skills the first one is that you should identify and Define what fundamental truths are so if you identify the most basic truths or elements in a problem that's actually really important when you're developing a piece of software this can include analyzing the needs of your users having a good understanding of what your software is supposed to do having an understanding of what the domain looks like basically before you spend any time trying to actually solve a problem you need to spend time understanding the problem but it's not just the problem itself that you need to understand it's also understanding the benefits limitations of the tools that you're using what are the strength and weaknesses of programming languages the cloud infrastructure that you're intending to use any of the supporting tools when you Zone in on these fundamentals you going to get a better understanding of what the problem looks like that is trying to solve and by understanding better you'll reduce the chance of making mistakes later now when I say understanding I don't mean that you should design your software to The Last Detail I'm not promoting that we all go back to the word full model it just means that you optimize for problem Clarity so you'll have less surprises when you start solving things and what's interesting is that that also relates to your own limitations as developer as well if you're asked to develop a feature you may be tempted to try that new library that you heard everybody talking about because you want to learn how to use the library but realize when you do that that you're actually changing priorities you introduce an unknown you don't know how that library is going to perform because you never used it so what is your priority do you want to learn about the library and accept that the project may be delayed because it's going to take you more time or there are unforeseen consequences of uset library or do you want to focus on adding the feature on time and making your customers very happy and there may be an overlap because that Library might actually solve a problem that you're looking to solve but be aware that you are prioritizing you want to deliver the feature or you want to improve your skills you need to pick one if it's improving your skills that's fine but make sure you're transparent about it and that it may lead to un seen problems or delays it actually took me quite a while before I really understood that improving my skills and delivering feature would do different things it may seem like completely obvious but it's really easy when you're in the thick of things to just forget about that distinction and diving into some sort of rabbit hole and never getting out of it again a second thing you should do is break down problems to their core so next to understanding problems it's also really important to dissect problems and understand what the core components and challenges are and this can actually lead to better solution because then you can address the root of that problem for example let's say you get a task of creating a system that analyzes stock portfolios and then prepares reports automatically so instead of just diving in and start coding and coming up with ad hog Solutions you can also first take some time and break down the problem to the core and then you might realize that in essence this application is a data Pipeline and that means you can use a pipeline or workflow system and build your whole application around that with which leads to a much more flexible solution now if you didn't break up the problem before you wouldn't have come up with that solution another way of thinking about this is how you incorporate design ideas into your coding practices I sometimes hear other developers ask what design pattern should I apply here in my opinion that's actually the wrong question to ask it's not about applying design patterns it's about understanding what a problem actually is and once you spend the time to understand the core of a problem then deciding on the design pattern that should solve it is actually trivial because design patterns are intricately linked with classes of problems so instead of asking what kind of design pattern you should use ask yourself what kind of problem is this in the core what kind of thing are we dealing with and then take it from there the third thing is to reassemble elements innovatively so once you understand basic elements of a problem you can can reassemble them in innovative ways and that's going to create new solution and often this is where big breakthroughs and really new things happen it may sound cliche but the iPhone is a really good example because it combines separate things into an Innovative new single device when you think about software design don't feel obliged to follow design patterns to the letter but adapt them to what you actually need and combine them in different ways and same goes with functions you can also combine them in various ways you can pass a function as a parameter to another function you can put functions in a list or a dictionary you can use closures you can have a function that returns another function there's tons and tons of possibilities another new area where you can think about these kind of things is large language models how can you incorporate them into the software that you're developing what kind of features are suitable to use an llm for and how does that integrate with the rest of your code and what does it mean in terms of the function alities of what it will deliver the fourth thing you should do is validate your assumptions regularly as you're developing that piece of software always question and validate your assumption throughout the process it's going to keep your solution relevant it's going to avoid unnecessary complexities in the past it happened to me quite often that I ended up diving into some sort of rabbit hole to get a feature working exactly the way that I wanted to but when I thought about what was actually needed in most cases I could have saved myself bunch of time by just letting go of some things for example I remember a project where I was spending way too much time trying to fix some esoteric typing issue with generics I mean type annotations are great and awesome it's really nice if you can get them just right but in some cases it doesn't have to be perfect sounds weird me saying that but it doesn't have to be because especially if it's code that just you are going to use internally it doesn't matter too much and it's way better to spend your time on something that's going to make a bigger difference another another way of thinking about validating assumptions is by writing software test write unit test using for example by test to make sure that the code you wrote actually behaves as expected so don't assume that write a test to check it to make sure and by writing this test you're setting up yourself to validate those assumptions regularly and even better automatically the fifth thing you should do that's actually one of the most important things is to focus on Simplicity and functionality it's really important to maintain a level of Simplicity in your solutions to make sure that they're functional user friendly and not overly complex if you keep your code simple it's often easier to test and also easier to maintain so I always start with a simple solution and only introduce complexity if it actually solves a problem functions for example are typically a bit simpler to deal with in classes and inheritance so I tend to start with functions nowadays and only use classes if that actually leads to a simpler solution and same holds for other more advanced features of python for example I don't really use decorators or context managers or meta classes a lot because in my opinion they're often not needed and I prefer to keep things really simple and that also makes it much easier for me to test my code I will only use something like a decorator if I'm really convinced that hey this actually makes the code a lot simpler and a lot easier to deal with otherwise I just keep my codes using the basic set of features because honestly it's just a lot easier to manage and here's a bonus tip just make sure you learn continuously if you develop for yourself a culture of continuous learning and being curious that's actually vital to applying first principle thinking when you read books read articles watch videos it's going to help you get a better clearer perspective on the problems that you're trying to solve and it also goes for being updated with technological advancement and new programming languages for example now that python 3.12 has introduced way better generic types you can use them to write code with better type annotations assuming that you're not diving into some sort of rabbit hole like I did a couple of weeks ago another thing you can do to make sure you continuously learn is to make sure you're part of a community to help you my Discord Community is a great example of culture that encourages sharing knowledge and helping out each other if you'd like to join for free just go to discord. codes link is also in description below so this has not been my typical tutorial video where I show you a bunch of code but it's more a thinking video so I'd like to hear from you do these things trigger something do you recognize instances where you didn't do some of these things where you didn't apply first principle thinking and it led you to wrong decisions what were the consequences of that do you agree at all with this first principle thinking view on software development and design let me know in the comments by the way a good example of me applying first principle thinking is in my recent refactoring video where I show a five-step process that you can use to make dealing with Legacy code way easier you can watch that right here thanks for watching and see you soon

Original Description

👷 Review code better and faster with my 3-Factor Framework: https://arjan.codes/diagnosis. In this video, I'll cover 5 ways first principles thinking has helped me become a better software developer. These fundamental principles are game-changers, and by the end of this video, you’ll know exactly how to apply them to improve your coding skills. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses/ 🔖 Chapters: 0:00 Intro 0:50 Identify and Define the Fundamental Truths 3:18 Break Down Problems to Their Core 4:51 Reassemble Elements Innovatively 6:01 Validate Assumptions Regularly 7:21 Focus on Simplicity and Functionality 8:34 BONUS: Make Sure You Learn Continuously 9:32 Outro #arjancodes #softwaredesign #python
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from ArjanCodes · ArjanCodes · 0 of 60

← Previous Next →
1 Full stack WEB DEVELOPMENT in 2021 - the ULTIMATE tech stack for FAST web app development
Full stack WEB DEVELOPMENT in 2021 - the ULTIMATE tech stack for FAST web app development
ArjanCodes
2 FROM PRODUCT IDEA TO SOFTWARE - turn your idea into reality in a few steps
FROM PRODUCT IDEA TO SOFTWARE - turn your idea into reality in a few steps
ArjanCodes
3 Cohesion and Coupling: Write BETTER PYTHON CODE Part 1
Cohesion and Coupling: Write BETTER PYTHON CODE Part 1
ArjanCodes
4 Build a GLASSMORPHISM React Component - Typescript & Material-UI
Build a GLASSMORPHISM React Component - Typescript & Material-UI
ArjanCodes
5 Observer Pattern Tutorial: I NEVER Knew Events Were THIS Powerful 🚀
Observer Pattern Tutorial: I NEVER Knew Events Were THIS Powerful 🚀
ArjanCodes
6 100% CODE COVERAGE - Think You're Done? Think AGAIN.☝
100% CODE COVERAGE - Think You're Done? Think AGAIN.☝
ArjanCodes
7 Two UNDERRATED Design Patterns 💡 Write BETTER PYTHON CODE Part 6
Two UNDERRATED Design Patterns 💡 Write BETTER PYTHON CODE Part 6
ArjanCodes
8 1000 Subscribers! 🚀 WHY I Started this Channel and WHAT'S NEXT
1000 Subscribers! 🚀 WHY I Started this Channel and WHAT'S NEXT
ArjanCodes
9 Channel Trailer ArjanCodes - March 2021
Channel Trailer ArjanCodes - March 2021
ArjanCodes
10 Exception Handling Tips in Python ⚠ Write Better Python Code Part 7
Exception Handling Tips in Python ⚠ Write Better Python Code Part 7
ArjanCodes
11 Monadic Error Handling in Python ⚠ Write Better Python Code Part 7B
Monadic Error Handling in Python ⚠ Write Better Python Code Part 7B
ArjanCodes
12 GW BASIC Games I Wrote When I Was a Kid 🎮 Running 30 Year Old Code
GW BASIC Games I Wrote When I Was a Kid 🎮 Running 30 Year Old Code
ArjanCodes
13 Why You Should Think About SOFTWARE ARCHITECTURE in Python 💡
Why You Should Think About SOFTWARE ARCHITECTURE in Python 💡
ArjanCodes
14 Uncle Bob’s SOLID Principles Made Easy 🍀 - In Python!
Uncle Bob’s SOLID Principles Made Easy 🍀 - In Python!
ArjanCodes
15 QUESTIONABLE Object Creation Patterns in Python 🤔
QUESTIONABLE Object Creation Patterns in Python 🤔
ArjanCodes
16 If You’re Not Using Python DATA CLASSES Yet, You Should 🚀
If You’re Not Using Python DATA CLASSES Yet, You Should 🚀
ArjanCodes
17 CODE ROAST: Yahtzee - New Python Code Refactoring Series!
CODE ROAST: Yahtzee - New Python Code Refactoring Series!
ArjanCodes
18 7 UX Design Tips for Developers
7 UX Design Tips for Developers
ArjanCodes
19 Going All-in on Software Design in Python + an ANNOUNCEMENT 🎙
Going All-in on Software Design in Python + an ANNOUNCEMENT 🎙
ArjanCodes
20 🎙 Interview with Sybren Stüvel, Developer @ Blender 3D
🎙 Interview with Sybren Stüvel, Developer @ Blender 3D
ArjanCodes
21 Do We Still Need Dataclasses? // PYDANTIC Tutorial
Do We Still Need Dataclasses? // PYDANTIC Tutorial
ArjanCodes
22 7 Python Mistakes That Instantly Expose Junior Developers
7 Python Mistakes That Instantly Expose Junior Developers
ArjanCodes
23 Answering Your Most Frequently Asked Python Questions // Q&A 07-2021
Answering Your Most Frequently Asked Python Questions // Q&A 07-2021
ArjanCodes
24 GitHub Copilot 🤖 The Future of Software Development?
GitHub Copilot 🤖 The Future of Software Development?
ArjanCodes
25 More Python Code Smells: Avoid These 7 Smelly Snags
More Python Code Smells: Avoid These 7 Smelly Snags
ArjanCodes
26 Test-Driven Development In Python // The Power of Red-Green-Refactor
Test-Driven Development In Python // The Power of Red-Green-Refactor
ArjanCodes
27 5 Tips To Keep Technical Debt Under Control
5 Tips To Keep Technical Debt Under Control
ArjanCodes
28 Refactoring A Tower Defense Game In Python // CODE ROAST
Refactoring A Tower Defense Game In Python // CODE ROAST
ArjanCodes
29 The Factory Design Pattern is Obsolete in Python
The Factory Design Pattern is Obsolete in Python
ArjanCodes
30 Why the Plugin Architecture Gives You CRAZY Flexibility
Why the Plugin Architecture Gives You CRAZY Flexibility
ArjanCodes
31 Refactoring A Data Science Project Part 1 - Abstraction and Composition
Refactoring A Data Science Project Part 1 - Abstraction and Composition
ArjanCodes
32 Refactoring A Data Science Project Part 2 - The Information Expert
Refactoring A Data Science Project Part 2 - The Information Expert
ArjanCodes
33 Refactoring A Data Science Project Part 3 - Configuration Cleanup
Refactoring A Data Science Project Part 3 - Configuration Cleanup
ArjanCodes
34 Purge These 7 Code Smells From Your Python Code
Purge These 7 Code Smells From Your Python Code
ArjanCodes
35 Running A Software Development YouTube Channel
Running A Software Development YouTube Channel
ArjanCodes
36 Refactoring A PDF And Web Scraper Part 1 // CODE ROAST
Refactoring A PDF And Web Scraper Part 1 // CODE ROAST
ArjanCodes
37 Refactoring A PDF And Web Scraper Part 2 // CODE ROAST
Refactoring A PDF And Web Scraper Part 2 // CODE ROAST
ArjanCodes
38 How To Easily Do Asynchronous Programming With Asyncio In Python
How To Easily Do Asynchronous Programming With Asyncio In Python
ArjanCodes
39 The Software Designer Mindset
The Software Designer Mindset
ArjanCodes
40 NEVER Worry About Data Science Projects Configs Again
NEVER Worry About Data Science Projects Configs Again
ArjanCodes
41 Powerful VSCode Tips And Tricks For Python Development And Design
Powerful VSCode Tips And Tricks For Python Development And Design
ArjanCodes
42 8 Python Coding Tips - From The Google Python Style Guide
8 Python Coding Tips - From The Google Python Style Guide
ArjanCodes
43 What Is Encapsulation And Information Hiding?
What Is Encapsulation And Information Hiding?
ArjanCodes
44 8 Tips For Becoming A Senior Developer
8 Tips For Becoming A Senior Developer
ArjanCodes
45 Building A Custom Context Manager In Python: A Closer Look
Building A Custom Context Manager In Python: A Closer Look
ArjanCodes
46 GraphQL vs REST: What's The Difference And When To Use Which?
GraphQL vs REST: What's The Difference And When To Use Which?
ArjanCodes
47 You Can Do Really Cool Things With Functions In Python
You Can Do Really Cool Things With Functions In Python
ArjanCodes
48 Announcing The Black VS Code Theme (Launching April 1st)
Announcing The Black VS Code Theme (Launching April 1st)
ArjanCodes
49 7 DevOps Best Practices For Launching A SaaS Platform
7 DevOps Best Practices For Launching A SaaS Platform
ArjanCodes
50 Refactoring a Rock Paper Scissors Lizard Spock Game // Code Roast Part 1
Refactoring a Rock Paper Scissors Lizard Spock Game // Code Roast Part 1
ArjanCodes
51 Refactoring a Rock Paper Scissors Lizard Spock Game // Part 2
Refactoring a Rock Paper Scissors Lizard Spock Game // Part 2
ArjanCodes
52 Things Are Going To Change Around Here
Things Are Going To Change Around Here
ArjanCodes
53 Dependency Injection Explained In One Minute // Python Tips
Dependency Injection Explained In One Minute // Python Tips
ArjanCodes
54 How To Setup A MacBook Pro M1 For Software Development
How To Setup A MacBook Pro M1 For Software Development
ArjanCodes
55 A Simple & Effective Way To Improve Python Class Performance
A Simple & Effective Way To Improve Python Class Performance
ArjanCodes
56 How To Write Unit Tests For Existing Python Code // Part 1 of 2
How To Write Unit Tests For Existing Python Code // Part 1 of 2
ArjanCodes
57 How To Write Unit Tests For Existing Python Code // Part 2 of 2
How To Write Unit Tests For Existing Python Code // Part 2 of 2
ArjanCodes
58 Make Sure You Choose The Right Data Structure // Python Tips
Make Sure You Choose The Right Data Structure // Python Tips
ArjanCodes
59 5 Tips For Object-Oriented Programming Done Well - In Python
5 Tips For Object-Oriented Programming Done Well - In Python
ArjanCodes
60 Next-Level Concurrent Programming In Python With Asyncio
Next-Level Concurrent Programming In Python With Asyncio
ArjanCodes

This video teaches how first principles thinking can improve coding skills by breaking down complex problems, simplifying code, and avoiding over-engineering. By applying these principles, developers can create more maintainable, efficient, and scalable code.

Key Takeaways
  1. Break down problems to their core
  2. Use a pipeline or workflow system
  3. Reassemble elements innovatively
  4. Validate assumptions regularly
  5. Incorporate design ideas into coding practices
  6. Focus on simplicity and functionality in solutions
  7. Learn continuously and stay updated with technological advancements
💡 First principles thinking can help developers identify the underlying assumptions in their code and simplify it, making it more maintainable, efficient, and scalable.

Related Reads

📰
The AI Tool I Built for Myself Ended Up Becoming the Product Clients Asked About the Most
Building a personal AI tool can lead to unexpected business opportunities, as seen in the story of an AI tool built for personal use becoming a product in high demand by clients.
Medium · Programming
📰
Can AI Help Plan Your Next Holiday?
Discover how AI can help plan your next holiday, from destination suggestions to itinerary planning
Medium · AI
📰
Beyond ChatGPT: How I Curated a Toolkit to Build an AI-Powered Workflow (And Why I Built a Tool to…
Learn how to curate a toolkit to build an AI-powered workflow beyond ChatGPT and discover the motivations behind building a custom tool
Medium · AI
📰
Beyond ChatGPT: How I Curated a Toolkit to Build an AI-Powered Workflow (And Why I Built a Tool to…
Learn how to curate a toolkit to build an AI-powered workflow beyond ChatGPT and discover the motivations behind building a custom tool
Medium · Startup

Chapters (8)

Intro
0:50 Identify and Define the Fundamental Truths
3:18 Break Down Problems to Their Core
4:51 Reassemble Elements Innovatively
6:01 Validate Assumptions Regularly
7:21 Focus on Simplicity and Functionality
8:34 BONUS: Make Sure You Learn Continuously
9:32 Outro
Up next
Google Just Dropped A FREE Marketing Agent And It's INSANE (Pomelli)
Income stream surfers
Watch →