r/C_Programming • u/OrganizationFew6655 • Aug 20 '26
Hello World
I have found my people!! Hello guys I am a college student (mechanical engineering) and I was introduced to C in a mandatory programming course and C has been the best thing that has happened in my life. I had done programming before on java and python before and frankly I hated it , it was not really fun and it was tedious instead. So I had thought I hated CS but after coding in C and learning the things behind the abstractions i quite frankly fell in love with low level programming, it was the first time I got a passion for something and i spent the entire following summer digging up materials on it like learning computer architecture and learning to read and write Assembly and now I am learning Virtualisation and planning to start my first major project on C.
So in that note, let me ask you something:
What is your favourite project you have done in C?
11
u/ntsh_robot Aug 20 '26
Embedded used to be a specialty, but now almost everything is mcu or cpu controlled. Have you looked at the STM protoboards?
4
u/Weekly_Patience685 Aug 20 '26
if you're learning Virtualization im assuming you're following ostep? if not, here you go
https://pages.cs.wisc.edu/~remzi/OSTEP/
3
u/Zirias_FreeBSD Aug 20 '26
By all means, if I get this right and you didn't do any "real-life" (not lab example or exercise) project in C yet, start small! For my taste, "virtualization" and "first major project" are a bit too close to each other here. Trying to do something huge and complex as a "first major project" is a perfect recipe for failure.
My favorite is probably Xmoji because I chose an extremely "low-level approach" for an app like that, and diving down the rabbit hole of good old X11 was actually fun in the end.
But that's also an example for something you should never ever attempt before doing lots of smaller things. For example, many years back, my favorite was some cursed-based snake clone (and that certainly wasn't my first project either): cursedsnake
2
u/Slight_Season_4500 Aug 20 '26
Hey man! I have the exact same background. 4 years studying mechanical engineering and went back to school in cs and C is my favorite too!
You should look into Raylib or Unreal Engine (C++ = C but with messy extra features you can just not use)
2
u/[deleted] Aug 20 '26
I relate so much to this! I actually love coding in general but low level is absolutely my vibe. I personally don't understand people acting like low level coding is a chore and abstractions are a gift. To me abstractions are a double edged sword; yes they make creating a finished product faster but they completely eliminate the transparency and control that makes coding so special to me. I'm not saying i dislike high level -- Python is actually my second favorite language, but if I had to choose one language forever it would be C and I have zero hesitation in saying that. If you want to go further in C on your own (since you said you fell in love with low level) a fantastic textbook is C Programming: a modern approach 2nd addition (the first addition only teaches C89 and is outdated). It's widely regarded as one of the best programming textbooks of all time.
2
u/mathemetica Aug 20 '26
I think C is probably the best language to really learn the foundations. Arguably, assembly might be even deeper, but really C is close enough to assembly, but with nice QoL features. I had a similar experience where I had a hard time working with Java/Python because a lot was hidden behind abstractions. I think it actually makes sense to teach some assembly first, then stick with C for awhile, and then start looking at higher level languages/paradigms (oop, functional, etc). The average student would have a much deeper understanding of the material. It might have a steeper learning curve at the start, but once you got over the initial hump, it would actually be a lot easier to pick other stuff up, at least imo.
2
u/srhubb Aug 23 '26
For me it was my SCSI Device abstraction layer for our firm's SSD for Compact PCI: a bus interconnect for industrial computers, combining a Eurocard-type connector and PCI signaling and protocols. Boards are standardized to 3U or 6U sizes, and are typically interconnected via a passive backplane.
My software was the SCSI device. The Compact PCI hardware interface on our card invojed me via a Jump Table at my code's zero offset based on the SCSI command code the host had submitted which in turn invoked the appropriate SCSI routine in my code specific to that SCSI command the host had initiated.
I in turn managed the SCSI level "interface" where I emulated a hard disk accepting Block Device commands from the host and calling my hardware interface via Register manipulations for actual reads and writes to the memory arrays on our cards while maintaining the Sense Bytes and Status Byte returns to the host.
That was my last favorite C implementation. Prior to that it was implementing/creating a C Compiler for a Sperry+Univac mainframe back in the 80s when there was no such animal. My base for that project was a C Compiler from a PDP-11.
32
u/sciencekm Aug 20 '26
"learning computer architecture and learning to read and write Assembly"
You are on the right track.
14
u/LordRybec Aug 20 '26
I program mainly in C and Python. Python isn't too bad, but it's well removed from the hardware. I'm most comfortable in C though. I also love programming in assembly when the opportunity arises.
I'm not sure what my favorite C project is. I've written some game demos (mostly just basic code that does one or two things that would be required in a game) in C that I really like. I've written a handful of simulations, particle simulations mostly, and those were also really good.
The most complete project I've done in C is essentially a virtual audio processor. I had to basically design a full architecture with a machine language and an assembly language, and then I wrote a VM for it in C. Someday I plan to build a graphical program around it for making music. I haven't had time to do anything with that project in years though. It's probably my favorite so far.
I've also written a handful of display drivers for microcontrollers that are pretty high on my list. I haven't been active on it in a couple of months, but I'm working on a very basic 3D rendering engine to go with one of my display drivers. Once I finish that and get to use it in some other projects, it might end up being my favorite.
Maybe I should port my virtual audio processor to one of the microcontrollers I'm working on and make a music synthesizer...
Anyhow, welcome to C programming!
6
u/Constant_Mountain_20 Aug 20 '26
I couldn't pick just one. ckg, is the very first c project that I took seriously. I spent an entire summer trying to really understand how computers work. So I wanted to write my own personal c library that I can reuse on other projects. I think without this type of "reinventing the wheel" project, I would be a much worse engineer.
The second project is cj, this project is a JSON parser/formatter. I genuinely built this on a whim because I wanted to pretty-print my AST, and cJSON looked painful to use.
I really like the API and the usage of generics in C11 for this project.
6
u/dajolly Aug 20 '26
Writing emulators for old game systems from my childhood (NES/GB/GBC/GBA).
4
u/Key_River7180 Aug 20 '26
An HTTP server teaches you a lot, + it is really useful. You can also make it use the Gemini protocol or the Gopher protocol if you are into that.
1
u/Due_Sentence_2660 Aug 23 '26
Welp I'm a dumb cs undergrad who was pushing Javascript and python schlop for the better part of the first year of uni. I decided to make stuff in C again and it has been lwk fun. 2 of my decent projects are like one is a sort of like locap network discrod clone with backend in C and bubbletea based TUI and the other is a text editor (like vim but slightly worse lol)
I'm also trying to read up on how computers work, have been fiddling around with assembly code even though I'm far from being proeffecient at it and looking at how binary exploits work lol.
3
u/terra2o Aug 20 '26
> What is your favourite project you have done in C?
well... it's not exactly a low-level cool project like a virtual machine or whatever, but just a text-based game.
it's a game that tries to simulate every aspect of owning a tavern in medieval ages. just a side project kinda thing. doing it for fun.
3
u/thank_burdell Aug 20 '26
I love multithreading projects personally. Pthreads are my bag baby
3
u/Sea_Rise1831 Aug 21 '26
Reverse engineering one of my favourite games and adding features ive always wanted ☺️
3
u/DecisionOk5750 Aug 21 '26
You should learn Pascal in your free time. Try the Freepascal compiler, it's Free Software.
2
u/Jenkler Aug 20 '26
printf "Hellu World!";
2
u/lordlod Aug 20 '26
Embedded is fun, especially if you like the low level stuff.
Bare metal embedded gets you right down into the guts of the system. You work with registers, flip bits, and have only the low level abstractions that you want.
The constrained system also leads to some really fun innovation, playing with the code, preprocessor and linker to get the outcomes that you need.
As much as I love C as a (sometimes) professional developer I use it less and less on computers. Once you move away from hardware constraints there are few reasons to choose C over a higher level language or one that provides memory safety.
2
u/TrapperFlint Aug 21 '26
Congratulations! Never written any C myself but its a beautiful thing to discover anything you love. Enjoy your journey, friend!
2
u/Grumpy_Doggo64 Aug 21 '26
My personal favourite was figuring out the ASCII spinning donut myself. But my most impressive (for me atleast) was writing my own memory allocation functions and using SDL to make the Caravan game (from fallout new Vegas)
2
u/GreenAppleCZ Aug 24 '26
I love reinventing the wheel in C. If you want to have something, you have to make it yourself. All utilities.
So I make parsers and higher-level constructs just for fun, because it teaches me what the computer essentially has to do to achieve something that could be a one-liner in Python.
And making structures for algorithms, such as hashmaps or trees makes you realize what it really takes to have that. I remember using those in C# for really small amounts of data. I now know that an O(n) search really takes less than even initializing such structures. And that's the greatest gift of C.
2
u/Skibidibob4 Aug 20 '26
Then try cpp idk
1
u/NoSpite4410 Aug 21 '26
Probably the one I use the most is called 'duration' . It tells you the duration of a movie or music file.
It outputs in seconds, or SMTPE timecode if you need
hr:min:sec:frames.duration
1
u/Key_yeager Aug 22 '26
Yo amo C, me gusta leer código de Dennis Ritchie, su filosofía es simplemente hermosa su legado aún sigue con nosotros, nunca programe con tanta pasión como lo hecho en C, esto tiene un porqué: adoro el hardware y la programación bajo nivel
0
u/[deleted] Aug 20 '26
[deleted] — view deleted comment
3
u/[deleted] Aug 20 '26
[removed] — view removed comment
2
u/[deleted] Aug 24 '26
[removed] — view removed comment