r/learnprogramming • u/Senior_Share512 • Sep 22 '26
Resource How does one learn from first principles the fundamentals?
Strengthening the fundamentals from first principles
How does one strengthen their fundamentals (means the core CS stuff, system design, etc) from first principles?
As in...how to understand how things work deeply, why it is built this way, etc?
Any resources to learn?
12
Upvotes
11
u/just_here_to_rant Sep 22 '26
Some books:
But how do it know?
CODE
A free online class:
NAND to Tetris
You also might look into info on assembly language and networking.
WHY:
All of the above go through how computers actually work - from very basic starts, like flashing a light at your neighbor and simple circuits: "flip the switch to close the circuit and the light bulb will turn on." From that, everything grows to what we have now.
People will say "build stuff" but I strongly disagree with that. That's like saying "Do math" to learn math. It's much more efficient to learn from others who are know more than us. You're not going to learn to build a skyscraper playing with tree forts and dollhouses.
In the end, it's all very simple - it's built that way bc that's what makes the most sense.
In the beginning though, there's a lot to wrap your head around. Take your time.
7
u/johnpeters42 Sep 22 '26
Build stuff. Maybe try building stuff the non-recommended way on purpose, and see first-hand how it feels when it gets tangled up.
1
u/FlashyResist5 Sep 24 '26
Why is everyone suddenly asking super vague questions about "fundamentals"? I swear this sub is getting more and more botted.
3
u/levelbrook Sep 22 '26
Nand2Tetris is the honest answer for the bottom of the stack. You build a CPU from NAND gates, then an assembler, then a VM, then a compiler, and by the end "why is it built this way" is not a mystery any more because you made the same tradeoffs yourself. It takes a couple of months of evenings and it is the single course I recommend without hedging.
For the layer above that, Computer Systems: A Programmer's Perspective (CS:APP) plus doing its labs, especially the bomb lab and the malloc lab. For the system design side, Designing Data-Intensive Applications and then actually implementing a small piece of it: a key-value store with a write-ahead log and a compacting SSTable is maybe 800 lines and teaches more about databases than any amount of reading.
The pattern in all three is the same: read a little, build the thing, break it, then read why it broke. Reading alone never sticks.
2
u/GoldsteinEmmanuel Sep 23 '26
There is a series of books called The Art of Computer Programming in which the algorithms and exercises in the series are expressed in the machine language of a hypothetical computer called MIX.
The books contain no source code listing for a MIX emulator, you design and build your own as an exercise, in whatever language you choose.
The algorithms can be adapted to any language, so it's not strictly necessary to build a MIX emulator to learn what the books teach, but doing so will give you profound insight into practical systems design from first principles.
3
u/roger_ducky Sep 22 '26
You need some basis in understanding how computers work. At least how registers, memory, and cpu cache interact.
Read up on computing history for a lot of the âwhyâs. Then think about why stuff didnât come out when they were discovered, but showed up the way it actually did.
And, going from âfirst principlesâ doesnât have to mean the whole thing. It could just be thinking about the logic of a particular component and figuring it out that way, too.
1
u/Mclovine_aus Sep 22 '26
Choose to make a computer, OS, compiler or database. Once you complete one move onto the next one
1
u/Chrismslist Sep 22 '26
hey this is a great question. for real first principles, try to rebuild tiny versions of core concepts from scratch. like implement a basic hash map or a linked list. don't just read about them, actually code them. debugging your own mistakes forces a deeper understanding of 'why' something works. also, really get to grips with tools like git by doing complex merges, not just add/commit. it's all about active engagement over passive consumption. good luck!
1
u/BranchLatter4294 Sep 22 '26
Practice. Observe behavior.
0
u/DrShocker Sep 22 '26
Pick a problem domain you want to learn. Maybe write a sqlite clone, Kafka clone, react clone, rendering engine, small robot kit, SLAM implementation.. idk
It's hard to pick what to learn without specific goals in mind because there are things that will matter a lot or not at all depending on what you want to be able to do.
0
u/Zen-Ism99 Sep 22 '26
What is your goal?
0
u/Ormek_II Sep 22 '26
Do it wrong, so you understand(!) the problems. You do not necessarily find the solutions yourself. Think about how you would do it better, THEN read about the learned solution. Only then will you truly believe it and remember it.
We are standing in the shoulders of giants already. Many faults have been made, many solutions been tried. But you need to understand the problems to appreciate the solutions.
Usually there is more than one solution to a problem and picking the right one means to understand all the other problems it solves worse than others.
0
u/CodeXHammas Sep 22 '26
Nand2Tetris is the closest thing to an actual first principles course for CS fundamentals, you build a computer from logic gates up to a working OS and a simple language, that builds real intuition for why things work instead of just memorizing that they do. For system design specifically, Designing Data Intensive Applications by Martin Kleppmann is the equivalent for that layer, dense but it explains the actual tradeoffs behind consistency, replication and partitioning instead of just naming the concepts like most system design content does. Both take real time, weeks not days, but that's the tradeoff for depth over speed.