No video

Zig's enum-switch pattern is awesome | Zig tutorial part 2

  Рет қаралды 3,932

Matt Freire

Matt Freire

Күн бұрын

Пікірлер: 13
@lilzin69
@lilzin69 Жыл бұрын
Nice video! thanks for share! some cool observations: > 1. You can use the pattern `return switch(...) { ... }` ( i like it ); > 2. There's no need (sometimes) to type- annotate some variables ( like in `const score: i8 = switch(...) {...}` ) > 3. zig's style guide is, sometimes, interesting... I'm expecting the part 3!!
@simonralek7605
@simonralek7605 Жыл бұрын
Very nice video, looking forward the next one!
@CoolestPossibleName
@CoolestPossibleName 11 ай бұрын
Is ok to do that decrypt function something like this to have just one function? 'A' => .rock, 'X' => .rock, 'B' => .paper, 'Y' => .paper, 'C' => .scissors, 'Z' => .scissors,
@CallousCoder
@CallousCoder 11 ай бұрын
Nicely done. Initially is shivered about that nested switch, but it actually became very readable. There’s no need to type a const or a var when the compiler can infer it, saves a bit of typing.
@mattfreire
@mattfreire 11 ай бұрын
Hey! So cool to see you here. I remember watching some of your zig videos. Yeah I've been adding types unnecessarily and now forming a bad habit lol
@CallousCoder
@CallousCoder 11 ай бұрын
@@mattfreire You watched some of my tiny channel's videos! NICE! I really adored watching yours. The thing is you always pick something interesting up. Just looking to see how another person solves a certain problem I find useful. And in this case I was like... Hmmmm why??? Oh.. actually that looks really really nice! I am currently working in my own "sexual innuendo style" pin a series of embedded coding a Simon says game with Zig. It is not finding the same traction as my first Zig video though. Which I find interesting because Zig would be the best alternative for C on microcontrollers. Then again us embedded people tend to be very conservative :D But I am having fun doing it, its for me merely documenting what I do as a hobby. Although this I had initially done in Forth. Keep up your great work man! Your content is very nice you have a great knack explaining this, far more than I have! And let's hope that our little contributions help people to cross that threshold and also use Zig. It was also the community that made Rust big. And I like Rust too btw but I adore Zig.
@mattfreire
@mattfreire 11 ай бұрын
Thank you for the kind words. I agree - it's always good to see how other people solve problems. I plan on learning more about microcontrollers so I'll be sure to follow your series! Absolutely. I think people want to see a lot more zig content. Our little contributions will add up. It makes me excited for the future of zig and it's community
@CallousCoder
@CallousCoder 11 ай бұрын
@@mattfreire yeah me too! If foresee a great future for Zig. When something that even by the key maintainer is qualified as not production ready is already so good and usable, will make me wonder where it will end up. And I really like the group of maintainers, no political nonsense like we see in the Rust community. They are all super helpful and active. Great lectures that they organize. I truly feel excited when I watch anything zig related. And for an old guy like myself to be excited again for something in IT is unique 🤣
@kknaful
@kknaful Жыл бұрын
is it for zigzag?
@tahir-zaqout
@tahir-zaqout Жыл бұрын
great session 🥰 can you make a wonderful project by django please !
@ThomazMartinez
@ThomazMartinez 11 ай бұрын
im confused, defer is to remove the variable from memory right? why its called before its being used?
@mattfreire
@mattfreire 11 ай бұрын
Defer will execute an expression at the end of the current scope. Take a look here at the zig docs: ziglang.org/documentation/master/#defer
Hashmaps and a cool ASCII trick | Zig tutorial part 3
35:26
Matt Freire
Рет қаралды 1,9 М.
Zig in Depth: Project Setup
21:47
Dude the Builder
Рет қаралды 8 М.
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 19 МЛН
Нашли чужие сети в озере..💁🏼‍♀️🕸️🎣
00:34
Connoisseur BLIND420
Рет қаралды 3,6 МЛН
WILL IT BURST?
00:31
Natan por Aí
Рет қаралды 12 МЛН
Python vs C++ Speed Comparison
1:04
The Builder
Рет қаралды 2 МЛН
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 158 М.
Stripe integration to a Django application for beginners (part 2)
30:32
This memory pattern is why I'm using zig | Zig tutorial part 5
33:24
Intro to the Zig Programming Language • Andrew Kelley • GOTO 2022
50:14
Is 2024 The Year Of Zig ?
48:20
ThePrimeTime
Рет қаралды 154 М.
Why a linker author had to write a YAML parser in Zig
38:26
Zig Meetups
Рет қаралды 13 М.
zig will change programming forever
9:34
Low Level Learning
Рет қаралды 284 М.
What is the future of Django / Is Django becoming obsolete?
19:35
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 19 МЛН