Comments by "" (@pierreollivier1) on "I Will Not Write Rust Again" video.
-
@ІО-13ГлібШин Well there are many things that are broken in C for a multitude of good reasons, it's hard to blame them considering when the language was made. But many things are really annoying. The most broken things has to be header inclusion, this can lead to absolute nightmares because things will still compile, due to C relax rules about shadowing/definition. But once you flash it, it just doesn't work and you have to figure it out. On top of that you don't get a lot of visibility on the platform you are working on, on what types look like, because of the poor reflection, in Zig it's trivial to print a type info at comptime, even for weird targets, cross-compilation is a pain, linking is a pain, I mean it's not unusable per say, but you constantly have to keep in mind all of that C doesn't do for you that it should do. It might be counter intuitive but I'd rather have Zig or Rust compiler yell at me for missing something or doing something stupid, rather than C assuming I'm the god of programming and I cannot make any mistakes. There is also a ton of rules to keep in mind with implicit promotion rules, and also how they play with the thousands different typedef. It's also a language where everything is hidden in the compiler. One thing that's really nice in Zig is that I can just goto definition and I can inspect the source code of the std. I don't need to look what version of muslc or glibc I'm linking against, and then go look into their github. Figuring out which 200 #ifndef/#define is enabling which macro/function to understand how is the implementation for my thing. If you had the poor build system, and the poor ecosystem. C is really cool but I think it's time we try to get some better tools, because whether it's Zig or Rust, or any modern option, It honestly can't be worse than C.
3
-
@ІО-13ГлібШин The std is also very inconsistent, some function use errno, some returns -1 for errors, some returns -2, some returns 0, some returns 1, some returns NULL, some ask you to pass an out parameter, some needs to use a macro, I mean there is just an incredible amount of experience required to just be able to write C quickly, I'm Ok, I know the C standard really well, and the std, too so I don't have as much trouble with it anymore, but in Zig it's simple, you get an Error, or a null value or a bool, it's dead simple to just write correct code. You can make your api really consistent, and that's really really neat, when the project becomes large.
2
-
1
-
1
-
1