r/learnprogramming • u/_Jieunnie • 12h ago
What to do as beginner programmer? What to code? C/Zig
I really struggle with what to do as programmer, i know some basics of C and Zig (mostly just C). I did some stuff in raylib but it doesnt feel like real programming.
In raylib im just drawing shit on the screen and call it a day, there's no memory management. If there is, its very minimal. I could just use Godot at this point and have better results.
I could start with some CLI stuff but that feels like pretty limiting, i could use some TUI libs and work in them but still, im just using library with already made functions and management of resources instead of actually learning how OS works, how memory works and all.
Im currently making a small project called 'salt' which is just CLI installer for my theme (theme is wip, like wip-wip.)
I'd be really glad if someone could help me out with this problem of mine. ^^
2
u/WeepingAgnello 12h ago
Sounds like you're having trouble deciding between using a library, and actually learning how the library code works at the OS level. In other words, it's sounds like you're interested in learning how an OS works, and you also feel like you need to make a project. If all you want to do is learn how the OS works, just work on learning that instead of making a project. You'll come across ideas for projects as you learn.
2
u/jaysprenkle 12h ago
Create things that are useful for you.
I had very good luck creating a database to connect pets to be adopted with people who wanted to adopt a pet. I gifted it to a local shelter. It felt good and looked good on my resume.
1
u/teraflop 12h ago
I could start with some CLI stuff but that feels like pretty limiting
How do you know it's limiting if you haven't tried it yet?
If you don't have any better ideas, I'll repeat a recommendation I recently gave to somebody else: pick a command-line utility that you use, and try cloning it. For example, ls on Linux.
To get the basic functionality working, you'll have to learn a little bit about operating system APIs (in this case, the ones that let you manipulate the file system). And then there's some work to format the output correctly. And then if you read the documentation, you'll see that there are dozens of niche features that make it more complicated. I'd say that's enough to keep any beginner busy for a while.
If you want a bit more of a challenge, you can try building a simple shell.
Also, writing code is very important, but you shouldn't only be writing code. You should also be reading and studying existing systems, so you can learn from the many many thousands of smart people who have already figured useful things out. Otherwise you'll just be reinventing the wheel forever. This includes learning about algorithms and data structures, such as you'd learn in a CS curriculum, plus other stuff such as design patterns.
0
u/_Jieunnie 10h ago
Uh... that's sounds pretty cool tbh, trying to make ls from scratch.
That doesn't sound too hard, there's probably a kernel call which outputs first file inside directory. You get directory from program call itself, since argc[0] is always program name / location (if I remember correctly) and like, you loop througu until first result == current result (it will work only if it loops back after reaching last file, idk)
Honestly, no clue how it works but I'm already interested :3
ill figure out something, even if just look stuff up or read few lines in docs. That's always 1% more, which is key to improvement.
1
u/ToLurkQuietly 7h ago
What motivates you?
Like solving problems? Find a problem and solve it. Start with one that’s been solved and is simple. Try doing it your own way and see where you get stuck. Look at how other folks have solved it and try incorporating their approaches.
Like having fun? Pick something silly to do and just go nuts. Pick the dumbest output you can think of and try to make that happen.
Like gaining arcane knowledge? Pick an obscure piece of existing functionality with accessible source and read through it line by line, opening every help / man / readme along the way until you get how it ticks, then try to rebuild it.
The problem with programming is the beauty of programming - you can do anything with it. So it’s not about figuring out what the one right thing is to do, it’s about finding the way in that best balances maintaining your interest and exposing you to stuff you’ll find useful exploring your interest/s.
So yeah. The answer lies within. lol.
1
u/Aghoradas 6h ago
Any language you chose or have to code in is already built upon pre-made "functions" and then some, unless you're typing straight machine code. And even then, there is a predetermined mechanistic protocol. Just do something with the intention of finishing it. As a beginner its to some degree irrelevant what language it is, its more about learning the logic and approach of programming. These skills are applicable to any programming language, relatively speaking. If you want to dive deeper, look into how these libraries accomplish what they do. Keep on trucking.
4
u/Acceptable-Fig2884 12h ago
My first project was a text based choose your own adventure game in the console. I eventually added rooms, room to room movement, inventory, combat, an ASCII automap, etc. Learned a ton.