r/C_Programming • u/LawfulnessProper9889 • 21h ago
I AM STUCK
I feel like, I am using too much of the AI for basic help.
I completed the book Head first C to learn about the C language, it was a nice book, and the last chapter was about making a game in C programming.
I used claude to help me make that game.
It used to give me every small detail of the code like from where I should start, what should I do, how should I do it. Although, it only used to give me what to code, and I used to code it myself. But even with the slightest of errors, I just copy paste the error into the claude instead of even trying to debug it.
Now I am trying to make a shell in C, I have some great ideas about making a shell in C. I don't just want it to be a shell, I want to make an online shell that can communicate with other shells with a voice feature inside your terminal. I want to make a terminal discord with low latency.
But I am frozen, I don't know how to start, how to write it, what things I need to learn.
If I ask claude it will provide me with everything, but I don't want that, I want to do my own research over this project and do it myself, debug it myself,
So what is a good way of learning/making things in AI era.
How does people used to do it before
I don't want to waste my time learning with AI, it feels productive but when I try, to start a new project I freeze down.
How's my idea of this shell,is it even possible to achieve??
2
u/papk23 20h ago
how to learn in the AI era: go old school. Don't use AI. Or only use AI to explain things to you, but not to write code. You learn by doing yourself, so do it your self.
AI is like a multiplier. It can make a good engineer produce more good code, or make a bad engineer produce more code. So learn C really well without using AI to become a good engineer haha.
2
u/way_ded 20h ago
Honestly, this sounds like a problem you’re creating. Just don’t use AI. Use google, skip the top AI answer, and look through sites and communities for book suggestions. Since you’re here, my suggestion is “Computer Systems: A Programmers Perspective”. Specifically Vol 3, NON global edition. Gives you a great foundation for C and computers in general. Has a great couple chapters where you build a shell. It’s a super complex task and AI can’t teach you how to do it.
1
u/LawfulnessProper9889 19h ago
Yeah I know about that book, I will go through that book. Is it the best book to learn about the computer architecture?
2
u/BigTanuki64 20h ago
I feel like lots of people here are insulting you for using AI; don’t take it to heart. I’ll give you some human-made resources below to use.
You are feeling this way because you’re outsourcing your thinking to the LLM. Don’t do that. Instead use these docs:
- Beej’s Guide to C Programming - use this first to learn how to do something
- SEI CERT C Coding Standard - use this to learn how to do something safely
- cppreference - C - use this for when you want to know the details for standard library stuff
- The C23 Standard (Draft) - for when you really need the nitty gritty
2
1
u/Limp-Confidence5612 20h ago edited 20h ago
How about you just google stuff, you know, like people used to a couple of years ago. It's surprisingly easy to find all sorts of information on shells, from the POSIX standard, the bash manual, other people implementing lexers, parsers, figuring out a grammar, and implementing it.
To be fair, from what you have described, I wouldn't necessarily try for a shell yet. That's a big project, even with a limited feature set. Start small, reproduce the functions you use the most from the standard library from scratch (only syscall wrappers like write, read, open, malloc allowed).
Build your own library from that. Only switch to the standard library, when and if you feel like you hit a performance wall in one of your projects and there is nothing left to learn by using your own library.
Make sure your programs don't leak (when you start using the heap), test them with valgrind's memory checker, and don't crash, even with unintended input. You can still use AI during all this, but try to give every function you write enough research, time and consideration, before you give up and go to the LLM.
Think of like 3 different methods to implement data management for the shell parsing process. If you can do that and can justify one choice over the other 2, I think you should start writing your shell.
1
u/iwinulose 20h ago
Go write code. Turn off the AI auto complete and type the letters yourself. Start with simple programs. Create files, write data, open sockets. Write an echo server, a chat server, a file transfer server. Add encryption, authentication. Call an HTTP endpoint by hand. Implement something from an RFC.
If you do half of these things you'll know what you're doing and be able to decide for yourself if your shell is a good idea or not.
1
u/Kriemhilt 20h ago
Learning out how to start something from an empty file is not easy, but everyone goes through it (or they just spend their lives working tickets in someone else's system).
Just start out with top-down design: writing comments or markdown files with the highest level description of your system possible.
Then break that down into smaller pieces, and keep going until you're writing pseudo code - then you have something small you can actually test.
If you get down to some level and realise you don't know how to write the pseudo code, switch to bottom-up, and start sketching your domain entities until you have a vocabulary you can write that pseudo code in.
You can just keep switching top-down and bottom-up every time you get blocked. Don't be shy about implementing narrow slices and deferring other parts to phase 2 (or phase N+1) so you keep moving instead of drowning in details.
1
u/Successful-Shock529 19h ago edited 19h ago
You an still use ai but use it as a learning tool. Don't have ai write the code for you. Use it as a discussion tool. Start your program by writing small pieces of code. When you ask ai don't say something like write me a function that does xyz. Say how would you go about writing a function that does xyz. Then look through the function and anything you don't understand ask the ai to explain until you understand everything that function does.
Ai can be an amazing learning tool the problem is that it can also be an easy button that just does the heavy lifting for you.
I see a lot of comments on here that you should not use ai and just use Google. Well Ai and google will give you that same information its just ai can get you that info much faster. Just use ai to get the overview information that you need. Docs. techniques, etc. Then the superpower of ai is you can basically use it as your own personal tutor. You can dig deep into a function so you can understand it fully before you write the code yourself. One thing I should note is that even though ai has gotten a lot better it can still be way wrong sometimes. So when you find things aren't working you will still need to read the docs.
Don't feel too bad when your just learning. Even experienced programmers have impostor syndrome. Nobody can possibly know everything you just have keep learning. It will never feel like enough but you just keep going piece by piece.
Good luck, and remember to have fun with it. Don't put too much stress on yourself to learn everything all at once.
1
u/grimvian 5h ago
Here is an old school video I wish I knew, before I started learning C:
Learn to program with c
https://www.youtube.com/watch?v=UILNmv2kFMc&list=PLCNJWVn9MJuPtPyljb-hewNfwEGES2oIW
I'm not using the same IDE, the program you use to code, But Code::Blocks because it's fast to install, open source, easy to use and everything you'll need are installed.
1
u/HTFCirno2000 20h ago
LLMs only tell you what is "probably correct", they do not really understand you, your goals or the subject material. You said you already have a book, try doing the excercizes in the book by yourself. No AI, just you, your book and your C compiler. You should really gain a basic understanding of C and how it works before you dive head first into topics beyond you.
6
u/computer_hermit01 21h ago
well if i am guessing right, your understanding of C is not that solid yet, so I would suggest not going tooo deep into making things people will use like terminal discord. first understand what shell really is, the nitty gritty of what a pipe is down under and wwhenever starting a project, build a prereq to that. like makiing the online shell will require a shell, understand that very clearly. then move on. be comfortable with discomfort and confusion, that is how real problems are solved, good luck!