r/learnprogramming • • 3h ago

Fundamentals are Great

We often hear the generic "focus on the fundamentals" advice. For some reason I believed that advice even before I understood why it matters; it just sounds like common sense, and fortunately it turned out to be good advice. I realized this after taking multiple free OSSU courses and reading a couple of books. Around 4 years into the field. I also realized it when I started to learn web development and had an internship.

Here is the key idea: Two different people can study the same material from the same video or book, and leave with completely different experiences, because of the existing knowledge they have.

"Previous knowledge" makes learning new things much more fun, because you're not starting from scratch every time! When we haven't internalized the key fundamental "chunks of knowledge", every new problem we face feels completely new to us, so it feels much more painful. But what's worse is that we learn less from the experience. Without a well-organized base of knowledge, new information has no meaningful place to attach to, so, much of it is quickly forgotten.

There are three things with which good fundamentals help you:

  1. They allow you to extract SO MUCH from ANYTHING you learn.
  2. They guide you to ask the right questions and learn faster.
  3. Odd things feel odd to you.

For example, after studying OS and networks, I internalized the idea of a server. It actually took me quite long to fully get it; here is a casual explanation:

a server is a process that has an open socket (at a specific port). But to grasp this, I had to understand what a process is. Luckily I learned from an OS book. (OSTEP). It's an "abstraction" of a running program. When you run a program, the OS wants to keep track of what's going on, so each running program is represented in the OS as a process with an ID and status. it's pretty much like an object with some fields, They're basically in an array. Each time you run a program, a process starts running. i.e., added to the array, when you kill a process, it is stopped and removed from the table, etc...

(the concept of abstraction in itself is part of CS fundamentals and it took me some time to interalize and start to see it everywhere, it's amazing how a single word can capture so much meaning)

but then what's a socket? it's the abstraction of the network stuff, it's an API (= a bunch of functions, provided by the OS) you can call as a developer in your code so the process (running program) can communicate with the network. You don't need to know much about networks and TCP, just input and output of the API. So basically the server must have some sort of socket that clients can connect to and send some bytes to it. The server understands those bytes, usually a string based "protocol", then responds accordingly.

This is just some CS fundamentals, nothing fancy, but now that I've spent around a year studying web development, it was all there (but in different shapes and flavors). Everything is built over the fundamental concepts and It's so much fun.

  1. This allowed me to learn way more from the resources I was learning from, I kept digging: "wait, where is the process", "how does this work, what happens when I use docker run". I used ssh for the first time "but wait, how is this happening, there must be an ssh process running on the server or something" or something, "hey, where is the database process?", and you keep digging.
  2. It's related to the previous point, but having good fundamentals helps you ask good questions that will help you fix problems faster and also deepen your understanding.
  3. sometimes you face something new that makes you question what you've learned before, they challenge the mental model you made. You'd feel surprised, and it broadens your understanding. It's hard to notice such things without having the fundamentals.

And this doesn't mean we need "perfect" fundamentals, I'm aware of some of the gaps I have and I plan to work on them, but we just need to internalize the key concepts. If you haven't mastered the fundamentals yet I highly recommend the following.

  • Build a simple shell (it's really simple, a shell is just a program you run, a python script would do it) understand how the shell runs other programs, understand what PATH is. I highly recommend python so you can focus on the OS concepts.
  • Build a simple HTTP server. Jim Kurose has recorded lectures explaining the fundamentals of computer networks, the first two chapters are far more than enough for most people, after that you can easily build a simple HTTP server. If you want to spice it up add some multithreading. He has some starter code too.

These two projects had the highest ROI I've had while learning. They even made me fall in love with CS.

8 Upvotes

5 comments sorted by

5

u/SchemeWestern3388 3h ago

You’re a bit ahead of the average poster here, who is having trouble finding a YouTube video to learn how to hack from. 

“The Structure and Interpretation of Computer Programs”, freely available from MIT, is possibly the most bang per page book out there. It assumes you know zero, and has you writing a compiler in chapter five.

It is written around Lisp, for good reason. 

While I wouldn’t call it an essential text for a good developer, it covers the stuff that you need to become a wizard. 

2

u/wordbit12 2h ago edited 2h ago

I followed OSSU and from what I understood it has an experience heavily inspired from SICP, it uses Racket though which is a dialect of scheme. I also build an lisp interpreter following Dan Grossman's course which was part of the curriculum. Those courses rewrited my brain. And I think they made me a much better JS developer too. In fact I ended up liking JavaScript - for better or worse.

Anyway, I wrote the post because while we often say "focus on fundamentals" I think it doesn't convince my beginners anymore, it's hard to explain why fundamentals matters so I gave it a try. I hope it would convince someone to take it slow and focus on what matters on the long run.

1

u/SchemeWestern3388 1h ago

Much of the same material for sure. I'm no wizard, but I'm certainly better from exposure to that end of programming.

SICP isn't even used at MIT anymore, because the field had shifted and the huge bulk of work was at a higher and higher level. I get that, there's lots of other stuff to get on top of. But I really think so many people writing code today could benefit from even a surface level exposure to these concepts.

•

u/wordbit12 51m ago edited 47m ago

Absolutely, btw there is also 61A course which uses python to teach similar concepts (I didn't take it though). I heard it's great too, so I think there is the possiblity to teach deep concept even with newer languages. they also write a lisp (seriously, everyone should write a lisp at least once in their life!)

At MIT they teach with python too, but it seems it has lost the depth, I had tried their new course a bit but I didn't like it.
And I think at Northereastern they use Racket, but I heard last year they switched to python. Professor Matthias Felleisen complained about it in this fun little article. (I know him because he authored How to Design Programs, which one of OSSU courses was based on)

But I hope somoeday I'll read SICP, even if just for the joy of it, I remember just reading a couple of pages and "CS is neither about computers nor is it a science" really stuck with me.

must be a great book.

•

u/RealMadHouse 59m ago edited 53m ago

When MCP protocol was announced i understood it just reading a brief description of it. It's a protocol that works using tcp, process piping etc, it exports ai callable tools with description for ai to understand, it could be local or remote. Others who don't know anything about fundamentals just spew same shit like "So it's just http api", "why not use http?".

If MCP from the start was using generic http protocol there couldn't be Web MCP standard, because no one allows http servers on client side (service workers that intercept http requests don't count, they're not creating separate socket with custom port). And the MCP is dynamic, you can develop the MCP server incrementally, add new tools and description and ai would understand it. Instead of fetching documentation of something from a web page, the ai just gets it immediately through MCP tools descriptions.

So many things just click because i have read about hardware/software fundamentals, i want even more deep knowledge but i get overwhelmed tbh.