r/odinlang • u/Inevitable_Stock2807 • 3d ago
Odin as a first programming language.
Hello guys, I'm kinda new to programming and I know a little bit about C like pointers, functions, control flows, structs, how and what strings are, and other core basic programming in C. What I don't like in C are build system and macros, like it doesn't fit for me.
So my questions is that ok if I learn Odin without C background? My goals for learning programming are to make game engine and system programming. I like how things work behind the screen.
P.S: Sorry if my English is not that good.
11
u/qpax2137 3d ago edited 3d ago
My honest advice would be very simple:
Pick one language and stick to it, max it out.
It seems like Odin is a good pick 😁
1
u/NefariousnessFar2266 2d ago
Such a great post, this is the best advice for beginners.
Pick one language and stick to it, max it out.
3
u/Lubricus2 3d ago
Yea it's an great language with manual memory allocation and pointers similar to C but you don't need any macros or build-system and many other warts in the C language.
The downside is if you are learning for getting a job, then it's not many if any places asking for Odin developers. It's also more work to build practical programs than some other more high level programming languages.
It's excellent in places where performance is important and memory safety isn't paramount.
2
u/Inevitable_Stock2807 3d ago
i'm not really learning programming for getting job *at least for now. i just want to make cool things like games, or maybe OS. thank you for the advice.
1
u/Lubricus2 3d ago
It's an fun language to makes games in. If you want to make it easier and make some more complicated game, i would instead recommend using an game engine like godot.
If you are making an game to learn programing, Odin is the perfect choice.0
u/tialaramex 3d ago
In this context it's most important to find a language you enjoy working with and actually make stuff. So if you find that you enjoy Odin better then that's enough already.
Odin is surprisingly slow and clumsy for what it is, but nowhere close to enough to outweigh choosing a thing you will do over one you won't do.
6
u/Achereto 3d ago
I don't understand how that's even a question. Just learn the language you want to learn. You'll do fine.
5
u/Psycho345 3d ago
Some people think programming languages are like a religion. You can only pick one for the rest of your life.
They are just tools. But people learn how to use a screwdriver then try to chop trees with it. Because 10 years of experience with a screwdriver will make them chop a tree faster than readjusting their knowledge to learn how to use a saw, right? Sorry, it wasn't meant to turn into a rant about JavaScript programmers.
2
u/semanticlifer 3d ago
The logic isn’t so much religious but acknowledging the difficulty of changing course once one has picked a direction. This is less a problem if one approaches learning as a search for generalities and insight, rather than memorizing library functions.
Nonetheless, since I’ve written/learned enough C to be comfortable, I’m hesitant to really master Odin. However what little I’ve learned about programming while reading the Odin book (Zylinsky) has really helped me write better C.
So perhaps the better question is “which one should I pick to master?” Since you are right in that it isn’t a binary decision.
1
2
u/FireFox_Andrew 3d ago
Now is actually a very nice point to start learning programming with Odin because it recently got an update that introduced inline assembly. Basically,you can use Odin to learn assembly
2
u/X00000111 3d ago
Odin is great as a first programming language for those things. I would probably stick with C and maybe adventure into learning C++ or program C++ in a C way (very common in game dev and game engine development).
Rust is very interesting too, but different logic on the borrow checker aspect so maybe stick to Odin and the C languages
2
u/Alternative-Ad-8606 3d ago
I really like Rust as it was the first programming language I learned when starting out, but I have to admit that for most projects Rust lacks good and explicit libraries unless you know exactly what you want. For starters GUI libraries in Rust are either webdev, pesudowebdev, or bare bones compared to C/CPP counterparts. For more "back-end" and terminal-based app I find it really good if and only if you know what you are going to make and know the shapes of everything you want prior.
People joke about "rewrite it in rust" but for me that's exactly its niche, you have an all, you know what it's going to do, then you rewrite it in rust for the explicitness and security. As a newbie the project you will be making (or even me as I'm definitely not good at coding as I'm self taught). It's needlessly complex for how iterative the project will be as you learn.
2
u/BarnacleRepulsive191 3d ago
It won't be your only language, but yeah actually I would say it's a pretty great one to start with. It will be a bit annoying with how exacting it wants you to be. But honestly that's a really good thing while you are learning. Because it won't hide things from you, you have to understand how things work to write working code, and that's really good. Other languages even C, will let you get away with all sorts of bullshit. Which is great when you know what you are doing, but less great when you don't (or are bug hunting lol)
2
u/jacmoe 1d ago
Odin is a great first language!
It teaches you all the things that more high level languages - like Python or Java or C# - abstracts away. At the same time, you have access to a lot of things from the 'vendor' libraries.
Odin is smaller than C++, and - unlike C++ - you can actually keep the language in your head! Odin is simpler and more direct.
Excellent choice!
1
u/renghen_kornel 3d ago
I started with gw basic, then q basic then turbo pascal;using Odin as a first language is absolutely a great idea, you will learn so much and have fun along the way
1
u/g41797 2d ago
many modern programming languages sell themselfs as "best-C": zig/odin/c3/???
you don't need to know C to start learning one of them
but in order to understand "common denominator" my advice - start from old plain C
don't care regarding macro/build/etc
learn pointers/functions/structs/control flow - exactly what you wrote in your post
becuase C is old language it has not any modern features, you don't need them at the very beginning
After you will be comfortable in this "old staff" - take any language - you will understand very fast what was intent of specific language feature, which problem of C it solves and so on
Regarding second language - just if you are not looking for the job
if gamedev for own purposes is enough for you - take Odin
if you want just learn modern beautiful languge - take C3
if you want develop software for another developers - take zig
Human can make mistakes. Check important info
0
u/Asyx 3d ago
You don't need C to learn Odin. I don't even think that a low level language is necessary an issue. I think a much bigger issue is the amount of information you have available. In my experience, LLMs and Google are often not of much help. The LLM does not know enough about Odin, not enough people write Odin to give you good Google results. You are kinda stuck with the documentation so if that is lacking you are simply out of luck.
1
u/Alternative-Ad-8606 3d ago
Can confirm I use opencode as an over glorifies grep / man page machine and it knows f all about, for me that's great as it forces me to verify my findings.
I have found that the LLMs are great for figuring out the shape and flow of the problems youre trying to solve...
All in all as a learning Odin's thin LLM presence is a god send. Not to mention (in my own opinion) it's clear architectural advantages over learning Zig, it's a no brainer. I'm also learning C at the same time and I find that Odin's data flow has made me BETTER at recognizing how to do things and manage memory better in C.
1
u/According-Ad-7069 2h ago
You've picked a fantastic start - Odin's going to serve you well! I invested in https://odinbook.com/ and it's helped me build some decent Odin projects. I've also written a small guide, basically for myself, while I was learning Odin at https://nofuss.co.za/odin_and_me/, it might help you get started.
17
u/adderscript 3d ago
If you do really want to start with a lower level language Odin is probably a much better choice than c. They’re very similar, expect Odin has some really nice extra features like allocators and an amazing core library.