5 ms·
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 n
by hungnv 6y 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?
- Santosh83 6y agoSyntax 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 6y 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?
- AnIdiotOnTheNet 6y ago> Jumping thru hoops is what Zig seems to choose with its unorthodox, different-just-to-be-different syntax. Did zig run over your dog or something? You seem to be particularly hostile in your comments about it. As someone who has participated in discussions about zig syntax for years, I can assure you that a significant amount of thought and consideration goes into these choices. It is not "different-just-to-be-different". In fact, the very syntax being complained about is derived from other languages!
- pfalcon 6y agoNo, I'm adept of (anti)survivorship bias. In other words, I like to study mistakes. And Zig offers a great field of study in that regard, as many issues are seen with a naked eye (i.e. even to casual passers-by).
- didibus 6y agoWhat syntax would be the default?
- tkzed49 6y agoWhat makes "int" better than "i" as an abbreviation for "integer"? How will you get everyone to agree with you?
- BiosElement 6y agoI 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.
- alpaca128 6y agoClarity is important but I don't see how it suffers from that except for people reading code in that language for the first time. To my knowledge the languages shortening this to one letter are also the kind where the programmer can be expected to already know the fundamental data types, otherwise this syntax won't be the biggest problem. Personally I prefer it, mostly for subjective reasons but I think it makes sense - in the case of Rust it was the easiest syntactic novelty to get used to, things like lifetime annotations are a different beast.
- viraptor 6y agoIt 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.
- xyproto 6y agoC is not a language to emulate unless you think "unsigned short" and "long double" are beautiful ways to express signedness and the number of bits.
- viraptor 6y agoThat's a weird strawman. The long names are irrelevant here. It's not about C types overall, just stdint. Each of the languages mentioned uses intN in some form. When people do something differently than most other popular implementation it's good to ask if that's worth it.
- pjmlp 6y agoLisp.
- hansvm 6y 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.