▲ 63 ▼ What's the most fun programming language to learn? (piefed.ca) submitted 9 months ago by ageedizzle@piefed.ca to c/learn_programming@programming.dev 131 comments fedilink hide all child comments
[+] ageedizzle@piefed.ca [S] 1 point 9 months ago (2 children) [deleted] permalink fedilink source parent hideshow 2 child comments replies: [–] orclev@lemmy.world 1 point 9 months ago (1 child) It's a bit safer and a lot more convenient to use, but still lets you do dangerous things with pointers. At its core it's still fundamentally the same as C just with a bunch of helpful tools and features to make doing all the stuff you do in C easier and more convenient. Really the biggest thing it does significantly better than C is its macro system. C macros are "dumb" in that the C pre-processor does a simple find and replace on the source files without doing any kind of processing on the underlying C code so you can E.G. write C macros that spit out mangled illegal C code when you run them. Likewise a C #include is literally the same thing as copy and pasting the contents of the included file before it gets fed into the compiler. Zig on the other hand has a smart macro system that's actually aware of the zig code and works in concert with it at compile time. permalink fedilink source parent hideshow 1 child comment load more comments (1 reply)
[–] orclev@lemmy.world 1 point 9 months ago (1 child) It's a bit safer and a lot more convenient to use, but still lets you do dangerous things with pointers. At its core it's still fundamentally the same as C just with a bunch of helpful tools and features to make doing all the stuff you do in C easier and more convenient. Really the biggest thing it does significantly better than C is its macro system. C macros are "dumb" in that the C pre-processor does a simple find and replace on the source files without doing any kind of processing on the underlying C code so you can E.G. write C macros that spit out mangled illegal C code when you run them. Likewise a C #include is literally the same thing as copy and pasting the contents of the included file before it gets fed into the compiler. Zig on the other hand has a smart macro system that's actually aware of the zig code and works in concert with it at compile time. permalink fedilink source parent hideshow 1 child comment load more comments (1 reply)