top | item 25620009

(no title)

hungnv | 5 years ago

I wish all language as same syntax, no matter whats its implementation, no matter it has cool feature or not. So new comer will get use to it faster.

Why its not int64, int32, unsigned_int32, vec, function for all language, but inventors have to change these to u64, i64, fn...etc?

discuss

order

hansvm|5 years ago

> So new comer will get use to it faster.

Languages have many competing goals. It shouldn't take long to get used to u64 over, e.g., unsigned_int64, and brevity is valuable in its own right. Too many wasted characters can obscure the flow of a program and make it slower to read and understand.

Is it the right choice? I could be persuaded either way. I know it's one I've personally made before, choosing rebindings like i256 and cmpeq8 when doing a lot of bit-twiddly vector code.

tkzed49|5 years ago

What makes "int" better than "i" as an abbreviation for "integer"? How will you get everyone to agree with you?

BiosElement|5 years ago

I realize I'm stating the obvious, but 'i' is shorter while 'int' is slightly clearer. So I think there's a valid argument for both, but personally I think clarity is more important.

Having said that, less typing and clutter are also beneficial, so it's really a net natural debate.

viraptor|5 years ago

It existed before. Golang, Haskell, C, D (both kind of - int32_t), caml, and many others. It's i32 that deserves a "why this one?" comment.

Santosh83|5 years ago

Syntax has a heavy influence on function, so if all languages had very similar syntax, they couldn't be ideologically diverse without jumping through ridiculous hoops.

pfalcon|5 years ago

> couldn't be ideologically diverse without jumping through ridiculous hoops.

Jumping thru hoops is what Zig seems to choose with its unorthodox, different-just-to-be-different syntax. I wonder, how many will want to jump with it?

didibus|5 years ago

What syntax would be the default?

pjmlp|5 years ago

Lisp.