3 ms·
I don't understand this benefit. so in zig we are trusted to manage memory but we can't be trusted to overload operators in a sensible way?
by pharmakom 6y ago
I don't understand this benefit. so in zig we are trusted to manage memory but we can't be trusted to overload operators in a sensible way?
- jorangreef 6y agoI believe the rationale against operator overloading is not a question of whether the programmer should or shouldn't be trusted, but rather simply about optimizing for code readability.
- pjmlp 6y agoThen better integrate some static analysis with natural grammar knowledge to ensure all functions are properly named for their actual purpose.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- generichuman 6y agoThe benefit is that you don't have to be concerned about hidden function calls. You don't get unexpected function calls or performance hits this way. If you want your code to run fast, you need to ensure that you know what your program is doing and you're in control, at all times. Manual memory management enables that.
- pharmakom 6y ago... but operator overload is not really different to function overloading, it's just that the function name is infix rather than prefix.