Should You Learn C Before Zig?

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

КОМЕНТАРІ • 45

  • @your_sweetpea
    @your_sweetpea Рік тому +58

    Zig gave me the confidence and foundation to learn C comfortably. I was able to build a strong foundation programming in Zig and now programming in C is just "Zig but worse in these ways", essentially.
    I strongly believe if I had learned C first I would have struggled much more with C's sharp edges. I might have appreciated Zig more by the end of that, but the reverse path was much better.

    • @sleepysapphire2349
      @sleepysapphire2349 Рік тому

      Helloo, I want to learn zig as someone who only mainly has experience with python and Go. Do you have any suggestions of good learning resources for Zig?

    • @sleepysapphire2349
      @sleepysapphire2349 Рік тому

      Helloo, I want to learn zig as someone who only mainly has experience with python and Go. Do you have any suggestions of good learning resources for Zig?

    • @bus7104
      @bus7104 9 місяців тому +1

      The official doc and ziglings.

    • @valentinrafael9201
      @valentinrafael9201 6 днів тому

      I started C this past summer, for a month, took a break from it, then started Zig two weeks ago, and it made me understand C much better ( not that I want to use it or anything ).

  • @seanknowles9985
    @seanknowles9985 Рік тому +18

    We need more tutorials on how to use C libs in Zig. For example using C FFmpeg, how would we use that in a zig program to do some video transcoding?! Would be a really cool short video with a practical example!

  • @user-dz6il2bx5p70
    @user-dz6il2bx5p70 Рік тому +6

    I am currently learning Zig without any knowledge in C and I love it.

  • @ScibbieGames
    @ScibbieGames Рік тому +5

    I personally think otherwise, but I am probably biased.
    Because I knew C, I knew how Zig improved upon it.

    • @pierreollivier1
      @pierreollivier1 Рік тому

      same here I'm on the verge of crying by how much of an improvement zig is over C, the test "foo"{}, the build system, the functionalities, I've spent the last 6 months doing 8h of C everyday, and zig really feels like I'm seeing light for the first time in months.

  • @jonathanmarler5808
    @jonathanmarler5808 Рік тому +20

    This is the wrong question to ask. You can learn either C or Zig first, it doesn't really matter. You should start with whichever language inspires you more and enables you to create what you want to create. After you learn the first one, you'll learn what you need from the other one as you go.

    • @grafgrantula6100
      @grafgrantula6100 Рік тому +3

      Honestly, I think Zig is easier to learn simply because it is more explicit. When you learn a new spoken language you also generally start by learning how to say everything correctly and in the longest, most explicit form. For example you would learn "it is" and "it has" instead of the shortened "it's" for both, because that can easily confuse people.
      C has a lot of shortened "it's" syntax, Zig generally doesn't.
      If you want to learn both and are starting out and you mostly care about programming as hobby / for personal projects, then go with Zig first, C second.
      If you want to learn a language to get a job / contribute to an established project as a low level programmer, frankly, don't learn Zig at all (yet).
      Zig is currently for hobbyists and enthusiasts only (not a bad thing).
      I like Zig, but I'm currently still in C land. I'm using Zig as a C compiler, because it's just better than the rest :)

  • @trondenver5017
    @trondenver5017 Рік тому +15

    The correct answer is learn all you can.

  • @edgeeffect
    @edgeeffect 2 місяці тому

    I also think that this is one of the reasons there is so little Software We Can Love... Don't ask the question "which language should I learn" - that is the wrong question. Learn about basic techniques, learn about data structures, learn about design patterns, learn about UX, DX (and all the other "X"s)... learn the things that are actually important and learn them in multiple languages... better still, learn them in "lame" and "boring" languages. Learn really how to program... Do this and jumping from Zig to C to Rust (... ... ... to Fortran!!!) will be easy. And your software won't stink.

  • @charliegnu
    @charliegnu Рік тому +6

    I actually learned some C while learning Zig. I won't write C any time soon but I can read it and understand stuff like pointers and memory allocation.

  • @CianMcsweeney
    @CianMcsweeney 11 місяців тому +1

    I would say yes personally, in my opinion a "simple" language like Lua or something of similar complexity is best to learn first just so the beginner can focus on learning the basics of programming, then move to C, where due to how barebones it is forces you to implement many concepts from scratch such as Strings, general data structures etc. that will give you a super solid platform for moving to any other language, including Zig, where you can use the higher level abstractions while understanding what's going on behind the scenes

  • @dyXurChannel
    @dyXurChannel Рік тому +2

    I asked myself this question when I first came across Zig and all in all came to the conclusion that it really doesn't make sense to ask this question. In the end Zig is Zig and C is C. If I want to learn one then I shouldn't first learn the other. I do have needs for C (with some ASM sprinkled in) to the point where I wouldn't use Zig yet, but in some fields I'm working in I very much am eyeing Zig more and more as a valid option among other languages more so than an alternative.
    My path going forward will be that I will continue to learn Zig and C in parallel as the need arises instead of forcing myself to only use one.

    • @shrin210
      @shrin210 Рік тому

      You can write C in Zig right?
      Write full application in Zig, and you can also sprinkle C/ASM all you want whenever necessary.

  • @airbus5717
    @airbus5717 Рік тому +1

    i learnt Zig with C and it helped me learn C more than i could've done without zig

  • @_slier
    @_slier Рік тому

    i agree with all loris point.. actually while learning zig, it forced me to learn c too

  • @showerthought4u
    @showerthought4u 4 дні тому

    i agree that zig is the future of systems programming [rust is trash btw], but for that to happen it needs to have a big and stable ecosystem, and to do that you need programmers who have a strong understanding of the past/present which is C.

  • @ingmarfalk3306
    @ingmarfalk3306 Рік тому

    I have been considering leanring zig for a bit now.. that for some reason convinced me to do that xD

  • @darrellee8194
    @darrellee8194 Рік тому

    Really excellent point about developing blind spots due to how you first learn about someing (e.g malloc).

  • @Ratstail91
    @Ratstail91 Рік тому +2

    I don't know zig, but this video seems a little biased (not necessarily a bad thing if you're trying to evangelize a language). But my personal answer would be "it depends" - if you're looking for a good foundation for programming, I say learn both, but begin with C. If you're looking to solve a specific problem, I'd say zig might be your answer. I would like to learn zig myself, but I'm working on my own Toy language...

  • @FlanPoirot
    @FlanPoirot Рік тому +21

    start giving this argument once:
    - documentation is good and learning resources are vast (enough)
    - the LSP is decent and won't either crash or straight up not give you completions unless you have for example a while loop complete having stuff like "while (something." not giving any kind of completion
    this also works with say the GeneralPurposeAllocator not having any completion at all
    - Features are somewhat stabilized and you won't have a constantly moving target of a language
    Also not to mention that one learns a language to write projects and contribute to other people's, as of right now u just don't have that many projects in zig and u cannot make much of a meaningful impact outside of contribute to the compiler in zig. C still is and will continue to be in use, it's been here for 50 years and will continue to be, a lot of core infrastructure is written in it and they need maintenance.
    So the more reasonable/pragmatic way to go about it is to start with C but also learn Zig, but this might change in the future and u might start with Zig and learn C afterwards

    • @UliTroyo
      @UliTroyo Рік тому +13

      This is pretty silly. The context here is that someone is already interested in Zig, and they are wondering if they have to learn C first.

    • @sumofat4994
      @sumofat4994 Рік тому +3

      @@UliTroyo The video gives no context. Where would you infer this context? lol

    • @master74200
      @master74200 Рік тому

      I don't know if I agree or not with this post, however regarding C it's just a different language. Zig will fill gaps that previously could only be filled by C. Does it fill all gaps that C previously filled? No. It likely will not ever do that. Accepting that and understanding that they're different and although they overlap (a lot), they do NOT fill the same roles.

    • @FlanPoirot
      @FlanPoirot Рік тому +1

      @@master74200 I'm not arguing against u, in fact I agree with you. What I'm arguing is that zig is not ready yet so I would not recommend it for anyone that isn't already familiar with C yet

    • @master74200
      @master74200 Рік тому +1

      @@FlanPoirot Oh yeah 100%. For toying around and trying things? Zig is wonderfully fun to play with. But it's no fun having stuff in the language or tools break on you in production.

  • @basilcooper995
    @basilcooper995 Рік тому +1

    I'd say for the time being you've gotta go for C due to the available resources. Zig isn't doing badly when it comes to tutorials and docs, BUT most of the content is made from the perspective of C devs. A lot of it is comparative, especially explanations of pointers, slices and function arguments etc. It's just currently not established yet in a way that a complete novice will be able to traverse. That's all community though, from my experience, zig would be far more intuitive than C syntax wise.
    There's also the prob that you'll basically always have to interact with C for most tasks, at least for the next decade. And even though it's easy and clean, it's not exactly high level, you have to know what to expect from C's side. Idk, I just don't see how, without a drastic shift in community content and libraries, you could really use zig without some knowledge of C.

  • @defnlife1683
    @defnlife1683 Рік тому +4

    So, where’s the Zig equivalent to the K&R. I need me some courses to do some simple stuff and then keep goin’

    • @Halfbit_0
      @Halfbit_0 3 місяці тому

      K&R is my favorite textbook in general of all time. And I think it's not up to date with modern C. Wish there were more books like K&R though. It was such a comfortable read, I worked through it in under a week.

  • @the.real.ipatch
    @the.real.ipatch Рік тому

    love it dude. ❤ look forward to seeing more. what do you think of jemalloc? 4:55?

  • @sohpol
    @sohpol 11 місяців тому

    I'm learning Zig, because Rust is tough love ;)

  • @nanthilrodriguez
    @nanthilrodriguez 11 місяців тому

    When will zig get proper syntactic macros?

  • @adammontgomery7980
    @adammontgomery7980 Рік тому

    I think you've jumped the gun a bit here. C is simple and stable, and learning it forces you to understand how memory works. I think a week or 2 of learning C would be sufficient to go on to other languages but, to me, it's the simplest. Zig definitely solves some problems (mainly preprocessor stuff) with C, and I'll keep trying to figure out how to use it for embedded stuff.

  • @parkerhyde7514
    @parkerhyde7514 Рік тому

    Just know that you're gonna want to learn c.. you know eventually.

  • @happygofishing
    @happygofishing 3 місяці тому

    Learn C because it is the lingua franca.

  • @familyshare3724
    @familyshare3724 9 місяців тому

    No. Zig is easier to understand. Then you'll know why C will be replaced.