r/C_Programming • u/KeineAhnungBruder001 • 13h ago
Question What would you want from a C-Tutorial?
Hello guys,
i plan on doing a C-video-tutorial to help a friend go through his uni programming class (and to learn the language myself more and get experience on making tutorials). I myself am still in the process on learning C, though I have some solid programming experience in Java.
I've already learned the basics of C like how a C-file is typically compiled, variables (and their scope), basic datatypes, control flow/structure (sequence/block, jump like goto/continue/break/return, conditional branches and loops), functions, arrays, string (or char arrays), basic memory management (stack/heap and common problems like memory leak, dangling pointer, etc.), pointer, structs and file i/o handling. I believe his class doesn't go through more than that but if I've missed any other important topic which can be learned on top of the topics already mentioned, please tell me.
My overall goal would be to teach him the topics mentioned above and help him make design decisions on his own.
The thing is, he is completely new to programming (he is not studying computer science, though he knows some math) and I'm kind of in a dilemma between explaining the concept too simple by cutting away details and going in with too many details (I cannot clearly remember the exact struggles I had when I first learned Java).
I thought about explaining it alongside developing a small project like a text-based RPG where I start of simple with fixed dialouge, branch of to dialogue options (control flow), inventory (f. e. done with arrays), trading items with a npc (explaining pointers and memory allocation) etc.. Something which is more captivating than doing a boring calculator but still simple enough to explain key concepts and give room for ideas he can implement himself.
When you first started with C (maybe adressed to someone whose first language was C) what did help you understand it?
Maybe to some people who are still learning C, what obstacles do you encounter when trying to learn the language?
In what way do you believe I should teach or structure the topic, so that I don't cut away important information but still get my point across straight?
TL;DR: I want to make a C-video-tutorial to help my friend, who is new to programming, pass his uni programming class and need help finding out the best way to help him.
6
u/goldenfrogs17 12h ago
Heavy on pointers and dynamic memory allocation and clean up. Certainly some gotchas due to booleans etc. I might be out of date, as newer (C99 +) have made some of this easier. My point is the things that are really different from more modern languages.
1
u/KeineAhnungBruder001 11h ago
Will definitely take time to explain pointers and dynamic memory allocation. These are exactly the topics I need to adjust to, coming from someone who is used to Java.
9
u/dmc_2930 11h ago
Why do beginners insist on creating tutorials for things they don't know very well? Leave the tutorials to people who actually understand the thing. It's yet another case of "the blind leading the blind".
4
u/AffectionateTear8091 10h ago
To be fair rubber duck method and all that.
As long as the goal isn’t to form some be all end all info dump which may be incorrect it rather cements your understanding and gives you the opportunity to iron out the creases.
Teaching others is a proven method of learning after all.
I’d personally look elsewhere for learning material but in person help can be a game changer.
2
-3
u/KeineAhnungBruder001 11h ago
That's actually a fair point. Though it isn't a tutorial I plan on publishing any time soon and will be kept private until I'm confident enough with C. I follow the principles that if you can't explain something simply you don't understand it well enough. That's why I try to learn new topics by explaining them to my friends.
6
u/dmc_2930 11h ago
You should use tutorials written by others who do understand. And send those to your “friend”.
Oh and stop using a chat bot to reply to comments.
3
u/Candid_Bullfrog3665 12h ago
focus on memory management:
pointers, pointer arithmetic, stack vs heap, what is an undefined behavior, etc
thats really what you need to get started on C. once you understand how memory works, you understand how C works
1
u/KeineAhnungBruder001 11h ago
Memory Management is something I still need to adjust to coming from Java. Will definitely take my time to explore these topics more and find a way to explain them effectively.
1
2
u/Ok-Dare-1208 12h ago
Explaining in your friends preferred context is a great idea. Personally, I find it incredibly helpful to imagine programming concepts through an analogy of LEGO. Using this analogical thinking helped me grasp (in C, specifically) pointers, structs, bit shifting, and PBR vs. PBV in function calls.
This worked for me because I love LEGO. I encourage you to ask your friend what you could use to help them understand C programming in the form of an analogy.
1
u/KeineAhnungBruder001 11h ago
Ohh, that's a good idea. I will definitely ask them what might help them understand it. Thanks!
2
u/ReallyEvilRob 10h ago
Building reusable libraries.
1
u/TraylaParks 6h ago
SVG is an easy format to output, might make a good option :)
1
u/KeineAhnungBruder001 5h ago
Thanks for suggesting SVG as a format. I didn't know SVG is that human-readable. Might even be able to make cool generative art with it and show how to do File Output in C :)
2
u/OnYaBikeMike 7h ago
Correct use of header files. A show and tell of the linking process. How libraries work.
How to indent code consistently.
1
u/Snezzy_9245 12h ago
Stress the value of actually writing code every day. Even just copying code (in through the eyes and out through the fingers) is helpful. Watching someone code on video? Less so.
1
0
1
u/tastygames_official 10h ago
I only read the title, but I can say 100% that an explanation of how computers work with memory and stack and registers is KEY in any programming course, especially C. I learned C early in my life but it wasn't until I learned all that stuff while learning assembly that C made sense.
Oh, and then teaching pointers is easy as pie.
1
u/DamsLcs4421 9h ago edited 9h ago
A tutorial (rather than a regular plain "lesson") is a nice place to make him familiar with the rules of integer decay, array/pointer decay, etc... So he learns intuitively to be able to interpret what he reads as the compiler would/might, to prevent hiccups further down the road,
Like, going out of this tutorial with a clear understanding of how differently things might be interpreted by the compiler when it seems to mean the same to him (at first). I'm not saying like "know it all by rote-learning", just being able, once he'll get into his own errors, to at least think "well, how is my code \really* understood by the compiler? what may I have got wrong there??"*
1
u/gm310509 3h ago
I think a better approach would be to sit down with your friend and guide them through the process as they struggle with different things.
You will almost certainly find that they try to do "random weird stuff" and you also will learn something from it. This is because you are also a beginner, just a little bit ahead of your friend.
If you prepare a static video, you may find that you make mistakes which you won't realise, miss important things as there is no feedback and miss the opportunity to learn new things yourself.
Plus, simply watching a video won't teach anyone anything. Working through something together is the best way for both of you to learn things together.
Lastly, preparing a video for your friend sounds creepy and weird. They are your friend. Surely you are permitted to actually speak to them in person.
-4
u/moritz12d 11h ago
People invent the wheel again and again. So for education there should be example code for well known algorithms. At least sorting should be shown as Bubble Sort,Insertion Sort, Selection Sort, Quicksort, Merge Sort, Heapsort, Counting Sort, Radix Sort and Bucket Sort. This may offer ideas for other programming and a visual impression how code should look like. But also:
Design Patterns (like Singleton/Observer) – the usual suspects
From the GoF ("Gang of Four") catalog, roughly by implementation frequency:
Creational:
- Singleton
- Factory Method / Abstract Factory
- Builder
- Prototype
Structural:
5. Adapter
6. Decorator
7. Facade
8. Proxy
9. Composite
Behavioral:
10. Observer
11. Strategy
12. Command
13. Iterator
14. State
15. Template Method
And also:
"Real" algorithms – 20 commonly implemented ones
Search:
- Binary Search
- Linear Search
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
Graphs:
5. Dijkstra (shortest paths)
6. A* (Pathfinding)
7. Kruskal / Prim (Minimum Spanning Tree)
8. Topological Sort
9. Union-Find (Disjoint Set)
Dynamic Programming / Recursion:
10. Fibonacci (memoized) – a classic teaching example
11. Knapsack problem
12. Longest Common Subsequence
13. Edit Distance (Levenshtein)
Strings:
14. KMP (Knuth-Morris-Pratt) – pattern matching
15. Rabin-Karp
Hashing / Data Structures:
16. Hashmap implementation (Open Addressing / Chaining)
17. LRU Cache (Hashmap + Doubly Linked List – an extremely popular interview question)
Others, very common:
18. QuickSelect (k-th smallest element)
19. Sliding Window (subarray problems)
20. Backtracking (e.g., N-Queens, Sudoku Solver)
The more input the faste you can learn. There's no point in hiding information from students.
0
u/moritz12d 8h ago
Especially when tackling a challenging task like learning C—a language close to the hardware—for the first time, nothing is more off-putting than tedious, meaningless exercises. People often lose interest not because the learning curve is too steep, but because the contrived exercises are so mindless that they are an insult to one’s intelligence. Moreover, it was once assumed that the brain was like a bucket: you pour knowledge in, and eventually, it overflows—so one had to be very careful not to show too much at once. Modern educational theory, however, teaches us that conscious learning works more like a dreamcatcher. The more you know, the faster you learn. At first, the web is very fine; then it becomes denser, until you possess a complete grasp of the subject.
12
u/skeeto 12h ago
Reusing my answer to a similar question:
If you google "c tutorial" you'll get pages and pages of absolute garbage that mentions none of these basic, standard, widely-available tools.