r/cprogramming • u/Lost_Eagle_6927 • May 06 '26
Beginner learning C and I found a useful way to use AI as a beginner
I have taken a couple of computer science classes and they were both in C. We covered things up to linked lists, searching and sorting, and a little bit of recursion. But everything I see on this subreddit is like reading a foreign language. I read somewhere to just try to read C source code, and found out the source code for DOOM is publicly available. I started at the main file. The first function I got curious about was the FindResponseFile(). So I asked the chatgpt what the the purpose of the function is, and WITHOUT showing any code, how the function works. Through that, I found out AI is pretty good at breaking complex things down to something understandable. I then tried to implement it myself the "old school" way with nothing more than googling and looking through stack overflow for things like parsing through a file and tokenizing strings (found the cool strtok() function). I feel like I just learned more about C in the last couple of hours than I did in weeks of school with this approach. All this to say, I feel like new programmers can learn with AI as a tool. But it has to be a tool, and not the thing writing the code.
5
u/edwbuck May 06 '26
The pros and cons.
Pro: you're effective.
Con: you might lack the ability to do the job without the tool.
Just make sure you craft your career to have more pros and fewer cons. If you can't understand code without a code understanding translator, then that's a big liability over time, but not so much when you're learning.
5
u/Tall-Introduction414 May 06 '26
Nice! I remember reading some of the Doom source code and finding it enlightening.
Similar with NetBSD and UNIX v7 source codes (like for common utilities like ls, grep etc). Not as complicated as GNU and Linux code.
22
u/I__be_Steve May 06 '26 edited May 06 '26
I'd say this is the only acceptable way to use AI, though you can absolutely learn without it, you just have to start at a lower level and work your way up
9
u/Cerulean_IsFancyBlue May 06 '26
I think that asking AI questions and having it explain things is a good way to use the tool.
I guess the comment is super obvious but, shame doesn’t stop people from posting obvious things so. Here we are
1
u/arihoenig May 06 '26
Doom is highly optimized code that includes one of the most famous optimizations in history (fast inverse square root). If you can read and understand doom, you're good to go.
2
u/demetrioussharpe May 07 '26
That is THE way to use it.
1
u/[deleted] May 07 '26
[removed] — view removed comment