←back to thread

55 points atomlib | 1 comments | | HN request time: 0.225s | source
Show context
up2isomorphism ◴[] No.41916250[source]
What is the benefit of changing

int main(void) {

to:

pub fn main() !void {

Except making it looks like a "new" language and requires other people spends 15min to get to used to it?

replies(7): >>41916321 #>>41916432 #>>41916718 #>>41916842 #>>41917078 #>>41919485 #>>41920533 #
1. audunw ◴[] No.41919485[source]
If you have a lot of experience with C, and take just a glance at the basics of Zig, I think you’ll understand why each of those changes were made. C doesn’t have very good syntax. Nether for compiler (correctly interpreting the code requires a lot of context), nor code editor, nor for humans.

If you have experience with some modern languages, you’ll definitely understand the syntax. Zig is close to a style of syntax that many newer languages seem to have settled on, and there are good reasons why that style has become prefer.

Why make a new language if you’re not going to make some improvements over the old? Seems like a very weird complaint to me.