Karl Zylinski
@zylinski.se
1.1K followers 180 following 290 posts
Wrote the eBook "Understanding the Odin Programming Language". Made the game "CAT & ONION". Check out what I'm up to these days: https://zylinski.se
Posts Media Videos Starter Packs
Pinned
zylinski.se
Understanding the Odin Programming Language 1.8 is out! The biggest change is an overhauled strings chapter. It explains UTF-8 and runes in a much clearer way.

Release notes are here: odinbook.com#release_notes

Also, see this thread for some free goodies related to the update.
Understanding the Odin Programming Language
Learn the Odin Programming Language and demystify low-level programming
odinbook.com
zylinski.se
Also, libclang will say that it is variadic.

In any case: In C, put (void) if you mean "no params"! Otherwise your code may cause warnings or errors on some compilers (extra important if you're making a library).
zylinski.se
What seems to be happening here is actually:
- MSVC converts it to (void) list automatically.
- But it doesn't show the usual warning that you passed too many arguments into a function.
zylinski.se
Yeah, if anyone uses it to do variadics then that's not very good.

But writing the list as () will produce warnings etc on certain compilers. So if you make a library, put (void) as parameter list, so your users don't get sad from it puking warnings.
zylinski.se
As an example, this compiles without any warnings on VS2022:
zylinski.se
I heard they fixed this in C23. However, many use old C versions such as C99, so the code works everywhere. That's half the point of C :)
zylinski.se
A common thing people don't know about C is that this function is variadic: `int some_func();`

You can throw in any number of parameters (including none)!

You say "accepts 0 parameters" you have to do this:
`int some_func(void);`
zylinski.se
Yeah, I often see stuff like

rl.InitWindow(1280, 720, "My Window")
defer rl.CloseWindow()

🫠
zylinski.se
There's nothing quite like being able to just copy-paste procedures between two projects and the code just working.

In general, code is easier to reuse in code-bases that just use structs and procedures, compared to any kind of class hierarchy.
zylinski.se
People who try languages with a 'defer' keyword tend to overuse it.

It has a cost: The code is harder to read because it is no longer linear.

My rule: Only use defer when there are multiple ways to exit a scope, and you need some code to run regardless of which exit it takes.
Reposted by Karl Zylinski
zylinski.se
An underrated skill in programming is learning to start over with the current problem.

I often see people trying to fix their current problem solution. Almost in denial of the solution's basic flaws.

Often its faster and better to just take some notes and start over.
zylinski.se
This one also makes me happy:

"I never read, I get distracted easily. But the writing style here is so good, that I didn't have any issues reading through the whole thing in a couple days."

I really try to bring the reader on a learning journey, rather than state dry facts.
zylinski.se
I'm very happy about reviews like this one:

"Karl makes a great job at explaining Odin. I had a good experience with garbage collected language like Golang and the book really helped me to transition to a non garbage collected language like Odin."

25% off until October 9: odinbook.com
Understanding the Odin Programming Language
Learn the Odin Programming Language and demystify low-level programming
odinbook.com
Reposted by Karl Zylinski
johanpeitz.com
📣 ICY TOWER IS COMING BACK
Stoked to announce that we're making a brand new Icy Tower game, ready for the 25th anniversary next year!

Check out the trailer, spread the news, and wishlist on Steam :D
s.team/a/3014860

More in thread 👇🧵
zylinski.se
Newsletter time! About rewriting parts of the Strings chapter in my book, and some updates on my 2D library + more! news.zylinski.se/p/odin-book-...
Writing about strings and lots of Karl2D updates
September really was a productive month!
news.zylinski.se
Reposted by Karl Zylinski
amidos2006.bsky.social
If you didn't play #HollowFloor, Go check it out on
#steam: store.steampowered.com/app/2815150/...
or
@itch.io: amidos2006.itch.io/hollow-floor

#indiegames #IndieGameDev #metroidvania #indiedev #indie #gamedev #screenshotsaturday #trailertuesday #wishlistwednesday #pico8 #platformer #challenging
zylinski.se
Updated CAT & ONION's Steam page with new descriptions that are more "me" and less dry.
zylinski.se
I've made a video based on parts of the new Strings chapter. It explains how to manually decode UTF-8 by inspecting the memory of the string: www.youtube.com/watch?v=Zl1G...
Manually decoding UTF-8
YouTube video by Karl Zylinski
www.youtube.com
zylinski.se
Understanding the Odin Programming Language 1.8 is out! The biggest change is an overhauled strings chapter. It explains UTF-8 and runes in a much clearer way.

Release notes are here: odinbook.com#release_notes

Also, see this thread for some free goodies related to the update.
Understanding the Odin Programming Language
Learn the Odin Programming Language and demystify low-level programming
odinbook.com
Reposted by Karl Zylinski