← back to blog

Why I Learned C Before Python for Cybersecurity

I’m writing this blog at night 3:30 AM, I don’t even know where my terminal is, and I genuinely don’t know why the f*ck I’m doing this while I’m supposed to be solving maths questions.

But anyway, here we are.

When I first started getting interested in cybersecurity, one of the first questions I had was:

“Which programming language should I learn?”

And honestly, Python seemed like the obvious answer. Everyone talks about Python in cybersecurity. It’s relatively easy to learn, there are libraries for basically everything, and you can make useful scripts without writing 500 lines of code just to make something work.

So naturally, I thought:

C → Python?

No. I decided to do the slightly more painful thing. C first.

>Why C?

Not because I think C is somehow better than Python. It definitely isn’t better for everything, and you absolutely do not need to learn C before Python to get into cybersecurity. I chose C because I wanted to understand what was actually happening underneath my code instead of immediately jumping to higher-level languages that hide a lot of those details from you.

One of the things that attracted me to cybersecurity in the first place was the idea of understanding how computers actually work. And C forces you to think about that. You start dealing with memory, pointers, addresses, data types, compilation, the stack and the heap, and eventually the relationship between your program and the operating system. These aren't just random concepts you learn for an exam. They help you understand what a computer is actually doing when your program runs.

And honestly, C can be frustrating as hell.

You make one stupid mistake and suddenly you're staring at an error for half an hour wondering what you did wrong. Sometimes it feels like the computer is personally offended by your code. But I think that's also part of why learning C has been useful for me. It forces me to slow down and actually think about what I'm writing instead of just throwing code together and hoping it works.

I also think learning C changes the way you look at programs. When you start understanding pointers and memory addresses, concepts that once seemed completely abstract start making a little more sense. You begin asking different questions: Where is this data stored? What is this variable actually pointing to? What happens when this program runs? Why did it crash? What is happening in memory?

And those are the kinds of questions I want to be able to answer as I get deeper into cybersecurity.

That doesn't mean I'm going to ignore Python. Quite the opposite. Python is probably going to become one of the most useful languages in my cybersecurity journey. It's great for automation, scripting, networking, working with APIs, analysing data, and building tools. But I want to learn it after I have a stronger understanding of the fundamentals.

Maybe I'm making the learning process harder than it needs to be. That's definitely possible. An intelligent person could easily argue that if the goal is to get productive in cybersecurity quickly, starting with Python would be the smarter choice. And they're probably right in some ways. But I'm not trying to speedrun learning cybersecurity. I want to understand the foundations properly, even if that means taking a slightly more difficult route.

For me, the goal isn't to learn five programming languages just so I can say I know five programming languages. I don't want to collect languages like Pokémon. I want to understand the concepts behind programming well enough that when I eventually move from C to Python, C++ or even shell scripting, I'm not starting from zero every time. The syntax might change, but the fundamentals stay with me.

And I'm still very much at the beginning of this journey. I don't have everything figured out, and there are definitely going to be plenty of moments where I question why I chose to make my life harder by learning C first. But for now, I think it was the right choice for me.

Anyway, it's probably getting later now, and I still have maths questions waiting for me.

So I should probably stop writing about programming and actually go solve them.

Although, knowing me, I'll probably end up opening the terminal again.

— bhavya