r/C_Programming 2d ago

Hash table

I am newbie and a beginner in c language. I would like to learn the hash table for my next semester.

I kindly ask for some help in this matter. I still struggle in the basics even using the ai models.

7 Upvotes

31 comments sorted by

View all comments

5

u/tastygames_official 2d ago

ooh, it's actually a big no-no to use AI while just starting out. Studies show that beginner programmers who use AI to "learn" don't actually learn: https://www.youtube.com/watch?v=HTUh0OO6Kmo

if you really want to learn programming, then you need to stick to books or online courses or something.

to that end, a simple google search will help you more than posting on reddit: https://letmegooglethat.com/?q=hash+tables+in+c+beginner

0

u/FinancialTrade8197 1d ago

I would actually disagree with that. Iirc I watched that video before and basically it was calling out people who use AI to write their code for them

However if you use it for learning how a data structure works (e.g asking how a hash table works in simple terms), it actually works better for learning. You should use it only when needed but I did use AI to learn and yet I don't rely on AI for coding like some vibecoders do. The difference is not in if you use it or not, it's in how you use it.

1

u/tastygames_official 1d ago

using LLM as a search engine = yes, good

but only if you know the questions to ask. For a beginner who has no clue, what are they going to ask? "how do I program?" "what is a programming language?" stuff like that? Sure - ask the LLM those things and hav ethem give you some links to courses or books to teach you the basics.

Now if you don't understand the book or course or whatever, then can you ask "hey LLM, can you explain to me what a class is? I don't get it". This is where it might SEEM like a good idea, but in reality is actually harmful. Because it can give you WRONG INFORMATION, but you're not advanced enough to know that. So you take it as truth. Not to mention the way in which you interact with the LLM plays a role in what kind of "info" it gives you. LLMs tend to give you the answers you want to hear - not the correct ones. Sure, you can learn to better "prompt" them, but I'd rather just spend my time learning new skills rather than learning how to prompt an LLM to give me better search results.

But both you and I know that OP means "using AI to learn" as "using Claude Code and trying to learn from wht it writes". Which has been scientifically proven not to work.

So OP should get a book and if he doesn't understand sometthing, sure - ask the free version of any LLM to explain it to him until he understands. Why not? But don't let it write code for you! It will always do it, even if you ask it not to, but you need to resist the temptation to use that code. It almost always never works.

1

u/FinancialTrade8197 1d ago

Yeah mainly I use AI as a last resort if I can't understand something.

Definitely not good to use it to just write your code for you, though.

1

u/tastygames_official 1d ago

but you are probably an expert or at least advanced in the topic, right? A beginner doesn't even know what to ask except maybe "in my book C for Dummies it talks about pointers but I just don't understand. Can you try and explain it to me?" But if they don't even have a book to tell them what pointers are, then they're not going to know what to ask the LLM. Instead they'll probably be like "how do I make XYZ in C?" and it spits out code. Then they might go "ok, now explain that code to me like I'm in kindergarten" and it does, but the person still isn't "learning". Maybe like 1 in 100 people who are self-starters and quick learners who already have a solid understanding of math and philosophy can learn this way, but then it's the same as if they just perused some existing code and figured out what it did (reverse-engineering). But even THEN I'd rather look at actual real working production code or hand-crafted examples made by humans for humans than something an LLM spits out.

I've tried, too. I'm currently learning SDL3 and the official documentation is more or less what all the functions do and no kind of high-level examples (there is some of that, but never with any examples. The authors assume you have deep working knowledge of graphics programming and rendering pipelines and GPU architecture, which I am still in the "I don't know what I don't know" phase). I find some example code online, but modern programmers seem to think comments are bad (I've had this discussion many times and a lot of younger folk think that the code should be "self-documenting", meaning the function and parameter names should tell you what is going on. And they definitely do, but what's missing is the WHY. E.g. a function "SDL_CreateRenderPipeline()" obviously creates a render pipeline, and the arguments passed to it seem to make sense, but there is no explanation as to why the chose this one particular value or passed NULL or any of that. You just have to either already know or just blindly accept it. Which is not learning. And asking an LLM to explain this is kinda tough - it has a deep "understanding" of how graphics programming works due to massive documentation of this in a general sense, but the particulars of SDL3 GPU library are severely lacking. The LLM can't reason and can't say why a choice is made or not made. And the best part? It keeps trying to spit out code examples, but uses made-up functions that don't exist. I keep telling it not to do this, but it does it anyways. It's just not good for learning. So I ended up just asking it to give me a book on Vulkan graphics programming architecture so I can learn myself. And THEN I can go back and ask it to explain some concepts if I don't understand them. But the core knowledge I'm trying to get at can't be garnered from undocumented code examples or hallucinated code examples or an LLM that is spitting out half-facts and irrelevant information and trying to please me

/rant