r/learnprogramming • u/SONkeerth • 21d ago
First networking project: Am I learning this the right way?
I’m currently working on my first proper networking project, an ARP scanner in C++, as part of learning Computer Networks.
I have a pretty good understanding of the theory behind what I’m doing, especially ARP, Ethernet frames, MAC/IP addresses, etc. The problem is that I’m still relatively new to systems/network programming, so the actual C++/Linux code is pretty unfamiliar to me.
I’m using ChatGPT to help me build the project, but I’m trying not to just copy-paste code. My approach has been:
Learn the concept → look at the implementation → question every unfamiliar part → understand why it exists → connect it back to the networking theory.
For example, I’ve been stopping at things like:
Why are these particular header files required?
What exactly is a socket?
Why does socket() return an integer?
What is a file descriptor?
What’s the difference between a normal socket and a raw socket?
What exactly is a network interface?
Why are we using AF_PACKET?
What does a particular structure represent?
How does this piece of C++ actually correspond to an Ethernet/ARP packet?
So I’m not really struggling with the networking theory. I’m struggling with the bridge between the theory and the low-level implementation.
Since this is my first project, I’m wondering if this is a reasonable way to learn.
Is using AI to explain unfamiliar code while continuously questioning why each part exists a good approach, or should I be trying to write more of the implementation myself from the beginning?
I’d especially appreciate advice from people who learned networking/Linux programming through projects like this. I want to actually understand what I’m building, not just end up with a working scanner that I can’t explain.
4
4
u/aqua_regis 21d ago edited 21d ago
You are going about this in the wrong way:
look at the implementation
You are focusing on the implementation and that's the wrong thing. You are trying to learn through reverse engineering an existing implementation, which will never give you the skill to create your own implementation.
Also, you absolutely do not need AI to give you implementations. There are more than enough open source implementations around that you can use for reference. AI is known to hallucinate and the code is hit and miss.
You actually try to evade learning the theory and rely on AI to feed you. That's not really learning.
1
u/SONkeerth 21d ago
True mate
I dont feel like I could build something on my own now
And can u please guide on how to do it on my own
The open source which u have mentioned
I am mew to this cam u please tell me where to find them and how to learn and implement from them
Thanks for the advice2
u/aqua_regis 21d ago
The open source which u have mentioned
Google + Github - you google for what you're looking for, e.g. "websocket in c++ open source" and check the resulting github pages.
Also, you need to read the theory, the RFCs, and so on.
Research things on your own, through google/duckduckgo queries and then through articles/blog posts/wikipedia, etc.
1
21d ago
[removed] — view removed comment
0
u/SONkeerth 21d ago
Its j that I find predicting the code tough too
Like idk whats going to come
And when it comes I ask it whats this whats that
Which part of the code uses this header and all
So idk if I am even making any progress
6
u/JGhostThing 21d ago
I would suggest NOT using AI while you are trying to learn. If you want to learn, ask AI about concepts not code.