5 ms·
That's one of the downsides of a BDFL. Zig is like 98% amazing, and 2% strange decisions that I think could have been avoided if the creator had more experience
by ForkMeOnTinder 3y ago
That's one of the downsides of a BDFL. Zig is like 98% amazing, and 2% strange decisions that I think could have been avoided if the creator had more experience with languages other than C and Javascript.
I'm still a happy Zig user though, and hey, there's still time before 1.0.
- pixelpoet 3y agoHe's actually fluent in a lot of languages[0]. Just somehow apparently not much sympathy for numerical computing, or UI code (I'm fairly sure you want 2d vectors there too), or plotting, or ... [0] https://andrewkelley.me/post/not-a-js-developer.html https://andrewkelley.me/post/not-a-js-developer.html
- dilyevsky 3y agoNot supporting operator overloading is not a “strange decision” it’s widely hated feature outside of very specific domains (like maths and graphics) and every shop i worked at which bothered with a c++ guideline banned it
- snovv_crash 3y agoBanned for in-house use, sure. Require an extra review before including a library, sure. But don't tell me you refuse to use Eigen and force everyone to write their own matrix multiplication routines that don't have operator overloading...
- dilyevsky 3y agoThat is why I specifically mentioned math and graphics as exceptions. Honestly I still like explicit DSL model better for these than trying to build dsl on top of your existing language c++/lisp style
- pcwalton 3y agoBut you have to use operator overloading to use smart pointers. This isn't a pedantic nerd snipe; the point is that operator overloading really is indispensable in certain contexts.
- tester756 3y agoYou guys are "interesting" in this c++ world C# has operator overloading and during my whole career I have never seen it abused so hard that people needed to ban it, let alone write guidelines and a lot of shops adopting it. I barely see anyone use it not for really good cases like graphics. The only interesting case was using "/" operator for Path Combines so "home" / "folder1" performs Path.Combine("home", "folder1") but still, that was PoC or lib, not even prod. So, is it about community, some culture or actually what?
- dilyevsky 3y agoI think it’s mainly c++ devs are very performance sensitive (why else would you subject yourself to this torture?) so they hate it when your ‘+’ is suddenly O(n^2) and with side-effects
- tialaramex 3y agoC++ operator overloading gets banned because C++ programmers invariably abuse it and cause problems, even the standards committee can't help themselves, which is how I/O Streams are a standard library feature. C++ also allows you to overload short-circuiting operators, but of course your overload can't short-circuit so you just silently destroyed an important feature. Why ? As others have pointed out, several languages have been able to provide this feature without causing half the mess and disappointment. Ten years ago if you said move assignment semantics are a bad idea you might persuade people because the C++ move semantics are messy, but hey, turns out a fresh language is able to just provide the destructive move developers actually wanted (but couldn't pull off for C++) and that's really nice.
- deleted 3y ago[deleted]
- throwawaymaths 3y ago> even the standards committee can't help themselves cout << "foo" << endl;