Zig Bytes 0x03: If Statements & Expressions

Поділитися
Вставка
  • Опубліковано 10 вер 2024

КОМЕНТАРІ • 44

  • @ZigIsGreat
    @ZigIsGreat  Місяць тому +10

    I apologize if the audio sounds strange at all in this one! My microphone totally gave up on me at the worst possible time, so I need to get a new one... 😓
    If it helps at all, I've just added English subtitles that are much more accurate than the automatic ones!

  • @venir_dev
    @venir_dev Місяць тому +9

    this was VERY clear, it's very accessible even for beginners. great content! keep it up!

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +2

      I'm glad I did the topic justice!! I was worried it would be too much. Thank you so much!! 🥰

  • @SaMusz73
    @SaMusz73 Місяць тому +2

    Nice episodes, Zig deserves good community content producers. Great job!
    the jump from assignments to arrays was quite huge, without going into details of the type system IMHO. Splitting if while and for is a good choice. Expectations are high in the comments, great job at reading them and implementing the desired changes.
    The capture syntax in the if statements is really cool.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +2

      Thank you very much!! ❤️
      I agree with everything you said, especially the first part about the jump - I've been trying to improve that since, and appreciate you letting me know that. The feedback is extremely helpful and I try to do everything I can to make this work for everyone :)

  • @jorgegomes83
    @jorgegomes83 Місяць тому +5

    Great video! Thanks!
    The code examples are way better now: not too small for smartphones and more vibrant colors. Thank you again.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +1

      I'm so glad to hear that!! Thank you for letting me know again ☺️🙏

  • @jwr6796
    @jwr6796 Місяць тому +1

    Very interesting! As a programmer, I've been itching for some of the meatier topics and what makes Zig different, and this definitely gave me a taste!
    if syntax handling ternaries, optionals, and error unions is really elegant and simple! I'm gonna enjoy playing with this when I can finally get away from JavaScript (for work 😅) and dig into some funtimes programming.
    I've dabbled a bit in Rust and like a lot of the syntax. These if options and exhaustive switch branches go a long way toward making up for no match statement!

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      That makes me really glad to hear you say that!! This was also one of the things that got me really interested in Zig, as optionals in Rust specifically can really tedious to work with.
      I think you'll probably like while and for loops in that case too ☺️

  • @vincentl7022
    @vincentl7022 Місяць тому +2

    Capturing values for If, switch and loops is so good because often the meaning of a variable changes in the context of the scope. I find myself writing less comments in zig because this additional name makes it clearer

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +2

      I really love this pattern too! It really reminds me of Rust's closure syntax, but applied to all of the conditionals.
      If you also use ZLS, the type hints are really good too! It just makes the development experience a whole lot nicer in my opinion.

  • @alexanderzikal7244
    @alexanderzikal7244 29 днів тому +1

    I also say Thank You!

    • @ZigIsGreat
      @ZigIsGreat  29 днів тому

      I'm glad I could help ❤️

  • @sanderbos4243
    @sanderbos4243 Місяць тому +1

    Great episode! :)

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      Thank you so much!! ❤️

  • @PeterKilian
    @PeterKilian Місяць тому +1

    I would donate to help you with a new mic, but I happen to be really struggling myself 🙈
    Wishing you the best!

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      No worries at all!! I wish you the best as well ❤️

  • @0z25y
    @0z25y Місяць тому +1

    your videos are 🔥 keep it up

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      You're incredible, thank you!! 🙏

  • @JoeyXie
    @JoeyXie 15 днів тому +1

    I prefer the rust syntax like if let and match to capture optional type

    • @ZigIsGreat
      @ZigIsGreat  15 днів тому

      It's definitely a personal preference, but I get it!! It can be confusing to some people as well.

  • @fishsayhelo9872
    @fishsayhelo9872 Місяць тому +2

    very gud, once again 👍

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      thanks again friend 🙏

  • @WistiiGaming
    @WistiiGaming Місяць тому +2

    What tool are you using to make those slides? They look really nice and smooth

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      Thank you so much!! I use Canva for that! It's a surprisingly nice experience to work with too! ☺️

  • @christopherwood6514
    @christopherwood6514 Місяць тому +1

    I really like the new colorscheme! What did you end up choosing for it

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      I decided on Tokyo Night by the incredible folke 🙏 the link should be in the description, I'll make sure!

    • @christopherwood6514
      @christopherwood6514 Місяць тому +1

      @@ZigIsGreatoh i missed that. Anyways, great video again!

  • @tuna5618
    @tuna5618 Місяць тому +1

    I'm guessing zig doesn't have any branching control flow (match/switch/case statements) because that's only for functional languages and also rust :(
    A shame.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +2

      Zig has switch! That episode is coming up soon-ish! That may seem underwhelming, but it's actually really cool. 😉

    • @tuna5618
      @tuna5618 Місяць тому +1

      @@ZigIsGreat Well that's better than nothing! Even if it's not as good at Kotlin's extremely basic pattern matching (idk why kotlin pattern matching is so stripped down) or the full pattern matching in functional languages and rust.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      I think it's pretty comparable to Rust at least! I still think Rust has slightly better usage, but it's close enough for me :)

  • @eineatombombe
    @eineatombombe 10 днів тому

    Why is your twitter suspended?

  • @jwr6796
    @jwr6796 Місяць тому +1

    Hey man,not sure how to get you privately, but:
    1. Can you get your Kofi link in your channel and video descriptions? Would love to help, but can't seem to find it and would prefer not paying Patreon if possible. 😁
    2. The link to your Twitter/X account says the account is suspended?

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому +1

      Haha, no worries! My email is zigisgreat@proton.me and I have that in my about page as well! It's always open ☺️
      To answer your questions:
      1. I can absolutely get my Kofi page back up! I DID actually have one for 2 seconds but deleted it because I was having doubts. I'll let you know shortly when it's back! ❤️
      2. Yeah, X really sucks. I'm waiting to hear back about my appeal, as this is the second time in a week that I've been suspended for "ban evasion" with absolutely no proof. Totally infuriating 😡

    • @jwr6796
      @jwr6796 Місяць тому +1

      @@ZigIsGreat hey, no worries on Kofi. You don't need to go out of your way. If Patreon is your method, I'll support there.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      all good!! most of it was still ready to go, so it should be good now!

  • @asdasd-by4hm
    @asdasd-by4hm Місяць тому +1

    Hello. Saw your post on reddit and it got deleted. Can you share your dots please?

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      I got suspended for some reason! 😓
      I don't have any publicly available yet but I promise I'm working on it!!

    • @asdasd-by4hm
      @asdasd-by4hm Місяць тому +1

      @@ZigIsGreatoh that’s unfortunate. Hope you’ll get unbanned. Cool vid btw.

    • @ZigIsGreat
      @ZigIsGreat  Місяць тому

      No worries! I'm hoping it gets reversed soon. Thank you ❤️