3 ms·
If Andy's watching, congrats! Two minor things: > zig init-lib and init-exe Wouldn't these be better off as "zig init lib" and "zig init exe"? I.e. do what g
by oblio 8y ago
If Andy's watching, congrats!
Two minor things:
> zig init-lib and init-exe
Wouldn't these be better off as "zig init lib" and "zig init exe"? I.e. do what git did when it switched from stuff like "git-annex" to "git annex": switch from compound command names to subcommands. Easier mentally to follow and remember.
There's also this:
> all control flow occurs exclusively via keywords.
This will probably never happen cause C looms too large in Zig's world, but I wish "*" and especially the super non-intuitive "&" go the way of the dodo and some short keywords replace them. Perhaps "ptr" and "deref"? This is technically just bikeshedding, but look at Rust threads: besides the obvious #1 difficulty of the borrow checker and ownership, the #2 complaint is that the syntax is weird due to sigils. "Modern" programming languages don't use many sigils, if any: Javascript, Python, Java, C#, etc.
It's not fair since those languages are GCed, but most people will be familiar with them, not with C, these days.
I know that it's doubly unfair since Zig's target is C, so it's expected that new Zig developers know C, but you want to get new developers wherever you can get them, in my opinion :)
- deleted 8y ago[deleted]
- simias 8y agoThe sigil thing is definitively a bikeshed. For one thing besides Python I don't don't know why you consider that JS, Java or C# don't use many sigils, these languages just happen not to have C-style pointers so they don't need that particular bit of syntax. More generally using C-style syntax means that C and C++ coders will be at home, while people from other languages will have to familiarize themselves with the concept anyway, sigil or not. Beyond that, I don't think I've seen any serious study on the acceptable level of sigils to maximize productivity and readability in source code, as far as I can tell it's really just a matter of opinion. Personally I'd take C syntax over Python every day of the month, and I've written quite a bit of Python. My only sigil-related problem with C is that '->' should really just be '.' IMO.
- espeed 8y agoThere's was a talk at StrangeLoop a few years back about a language syntax being designed based on user feedback from its ongoing usability studies. I'm on my phone now, but I'll try to find and post the link later when I'm at my computer if someone else doesn't find it first.
- Quekid5 8y ago> his will probably never happen cause C looms too large in Zig's world, but I wish "*" and especially the super non-intuitive "&" go the way of the dodo and some short keywords replace them. Perhaps "ptr" and "deref"? Beware Stroustrup's Rule[0] :). [0] https://thefeedbackloop.xyz/stroustrups-rule-and-layering-over-time/ https://thefeedbackloop.xyz/stroustrups-rule-and-layering-ov...
- oblio 8y agoWell, I was expressing more of a personal preference but I can't miss the opportunity to take a jab at Stroustroup, even if the rule seems good and valid, something went astray when he designed C++, so I guess Rule[0] was ok, the problem was with rules [1] to [99] :p On a more serious note, I think that this word form is concise enough and might emphasize code smells in a more modern language, where stuff like * *a should be super rare, IMHO.