The kernel pattern is a software architecture approach where you have a single entry point (like a main program file) and various modules that can be loaded or unloaded dynamically, similar to how operating systems load services. This pattern provides clean separation of concerns, makes it easy to convert to microservices by simply copying the entry point and module folder, and allows developers to include or exclude modules from startup. The speaker considers this pattern superior to traditional MVC for web development because it offers flexibility and modularity without the complexity of distributed systems.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
What is the best code you have seen?Added:
Hey guys. So today you and I are going to talk about the best code I've ever seen. So let's get into it. So the questioning question was, "Hi Frederick, what would you say is the best code that you have ever seen?"
That's going to be a little bit tricky in terms of like if you're talking about source that I've read or something like that cuz I haven't really had much to do with like the as you can imagine big open source projects and things like that because it's not something I've spent on all that much time on. I recall once upon a time though that I've had a few instances where I've gone out of my way to let my co-workers know that I thought that the implementation that they made for a specific feature or something like that was extraordinarily well written. I remember saying that to um one coworker many years ago who had the very it's like one of those horror scenarios where he had a I can't remember the specific feature now but I recall it had to do with time like basically being able to to run specific jobs at various time intervals and to get that just right and just so with different time intervals and conditions for when something should run and when it should not run and things like that that can be a little bit tricky at least I've always found it to be difficult to work with that and he had just done it so perfectly like a very simple interface he created for the functionality that was going to run very simple like just exactly the test cases like does it run exactly at the right time does it not run like a second early second late like because there was some transition needs in in there as well and he had just done it really cleanly no excess No, nothing. I had like basically nothing to add to it. I thought it just was a really nice solution. But if we talk a little bit more generically in terms of the best code I've ever seen or the best approaches to coding that I've ever seen, I would say for me who works mostly in web, my absolute favorite pattern, if there is such a thing in terms of how you write source code, would be the idea of the kernel pattern or the approach to doing software. I'm a very big believer in that if you follow that pattern with a modular monolith system, you will by default probably be better off than for most most other things. Like in the beginning of things, of course, everything at least what I was taught in school is about MVC because of course MVC is a very easy pattern to to follow. The thing that I usually say that I I think that that is when you mature a little bit because in the beginning you associate MVC with that there's a module folder, a view folder and a controller folder then everything goes in there right and my argument is that the MC pattern is not about having those folders. It is about how you layer your application logic or how you layer like divide the various areas where the controller for well most of us can agree to this where the controller is just the first thing that the network request sees. So the client system that connects to you interacts with the controller and then the controller uses the model and service layer logic and stuff like that in order to just glue together the business logic and like the data that is necessary and then the response will be the view and that can be an HTML page it can be like JSON or like XML depends on what the response is supposed to be right that model still works even you know that it's just a mental model and so when I grew up a little bit more I of course question this like everybody And then I sort of settled on after learning various patterns that I believe that my favorite version of this was because of course I bought into microservices very early on because they became the big thing right when I was in that perfect sweet spot between I've just learned enough coding so I know what I'm doing but I'm not so great at it. So I know what I should be doing and like what I should be listening to and what I should avoid. And so I bought into the idea and then was only after trial and error I came to the realization that the thing I'm trying to achieve with microservices is modularity between my various domains and like the functionality and stuff like that. And then I came to the realization that if I just don't move all that to the network layer because that is what microser will do for you. you will move most of the domain to the become it becomes a network problem right and then it something clicked in me and I realized but wait a minute isn't there a system for doing this that is already very established super super old which is I argue the kernel pattern you have a entry point into your program and then you have various modules that just you hook in and they load like when you start your operating system you have a start process that loads up all the other services and processes that you have and that is exactly the pattern you can move them so you can have them they can start up with your computer or they can not start up with your computer. And so when I real something clicked in my head when I realized if I just have a source folder with all my various modules for the various entities and business logic that I want and then all I have to do is expose like a controller or something like that from that folder and then have one single program.cs CS or you know main java or it doesn't matter which one it is right that just is literally it starts on the server on the port and then there's just a bunch of imports for the various controllers that are in the modules that I want I have a super super clean and very nice architecture so for me in web that were probably the biggest like yeah this is so clean it's so nice and my favorite part about it is that if you really do want to do microservices or move stuff out it is as easy as changing one line of code like copy pasting the the main like the entry point file and the folder that you want like the modules that are supposed to go into that other API and then you can start start running that instead right and if you have like a load balancer something or a gateway in front it doesn't matter if it's the same server or if it's 20 servers you can still it's very flexible that's the thing I liked about it but if we talk about things like just I remember like just being very impressed with the way that you write that software is actually not in game sorry in in web it is a game development and it was when I started playing around with I think it's Ammethyst the the it was the at the time I was working uh I was doing a lot of work with Rust because I thought Rust I still think Rust is conceptually probably the best programming language there is like I I wish that we were more into it as a community than we are but we're simply not there and the at the time I wanted to look into game development within that programming language and so the one that I found was amyst which was running something that they call entity component system or ECS which is a arch a software architecture that is at time I mean because I'm not a I'm not a game developer guys at all like I mean I know some very basic like unity and like learning a little bit about engine development and stuff like that. So I'm nowhere near an advanced game developer.
So when I heard about ECS, it was new to me. So it took me a while to understand the structure of how it worked. And I remember that when I sort of understood why it was created the way it was and the intention being that it should model the game world. I even like love the part about that there's I think I'm not sure if it's still there but I remember reading on the FAQ when for for the specific development framework that the first question is can you use this for web and they say no basically because I could immediately understand like when I understood how beautifully this system of writing code represent you know um different um things within an environment such as gravity or air like weather conditions or various entities that like like that exist in this world.
So if you want to model like a physical world of some sort like your own reality or something like that, it felt to me like this was a beautiful way of doing it. It was so so so intuitive and you have these various processes that affect them and so forth and then you can apply rules to various entities that are within this world and so forth and so forth. You can go and look it up if you want to. It's it's apparently as I understood it very popular in this in game development and it was just the most beautiful way I thought to basically represent a world and so immediately I go I wonder if my reality is done in exactly the same way some super entity somewhere in the universe God or whatever right has written all of my entire my universe the one that we share right in issue so what I want you to take away from this that I cannot really remember apart from like one or two co-workers over the years where I've thought that their code was just absolutely amazing where they really did that perfect like it's it's not too complicated. It is and it's not shabby in any way. It's just perfect like like I like to say guys writing really good software is like filling a glass just to the brim. And they really did it like on the mark. I had no comments, no nothing. It was just really really nice to see that they managed to solve the problem in my opinion in an absolutely flawless way.
And I mean if if I'm going to be nicer or looser with it, I mean the people the good people who make most of the tools that I depend on who have really great ideas and come up with stuff like that.
I mean they do reserve they deserve so much praise for all the work that they've done because I mean hell my job has become so much easier due to the fact that there are other people out there who are very passionate about something within the software space and they created libraries and things like that and so forth and I really do encourage you guys as well you don't have to give back to this community necessarily in the you know you're going to do some patch patches or pull request to some repo somewhere that's pretty nice if you can but try to follow the same rule right just start by what is it they say learn earn return those are the three phases of life so start returning some stuff and this is my one of my ways of doing it it's not the only way I do it but I try to follow the same pattern because these people they they deserve so much and apart from that I would say that my favorite uh one of the best ideas I've ever come across at by now at now at this current state at the very least would be to approach like module monoliths and the genius of the kernel pattern being able to load modules so include them exclude them from the start from a program it makes things a lot easier to handle when you're dealing with large systems and as you can imagine an operating system is a pretty complicated beast pretty large stuff and that pattern even though it's not exactly the same thing I found it to really help me when I do my web stuff and And finally, ECS for game development. I'm as I'm I'm going to be like one of those guys on the FAQ who goes like, damn, I understand that this might not be the right thing for a web project and it's more designed for game development and world creation and things like that, simulating various, you know, phenomenon in an in an environment. But if you take a look at it, I think you're going to find if you try to write some games or something like that that when you understand that you create various processes like you have characters of different types and then you have like things like gravity or wind resistance or things like these various these various processes, right?
The way it's structured makes it almost intuitive if you think about your own universe, how the universe gets constructed. You can more or less construct an entire universe with this modeling approach. And I thought it was just it was beautifully designed like whoever came up with it is up there for me with like the guy who came up with who came up with MVC for example and so forth and so you have some people who have truly inspired other developers to do to do to follow a pattern that they come up with and it just makes at least my job so much easier. Have a great day.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsβ’2026-05-28
How agent o11y differs from traditional o11y β Phil Hetzel, Braintrust
aiDotEngineer
450 viewsβ’2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanationπ―β
LearnwithSahera
1K viewsβ’2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsβ’2026-05-29
Search Algorithms Explained in 60 Seconds! π€π¨
samarthtuliofficial
218 viewsβ’2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsβ’2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 viewsβ’2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 viewsβ’2026-06-01











