3 ms·
If you view member access as a (global) function on a value (possibly an lvalue), then it actually makes a whole lot of sense. I find code dealing with structu
by jstimpfle 7y ago
If you view member access as a (global) function on a value (possibly an lvalue), then it actually makes a whole lot of sense.
I find code dealing with structures that have their members prefixed with a unique prefix much easier to read, usually.
Given the pervasiveness of APIs that contain struct definitions nowadays, it's also understandable that the unique-constraint was removed.
- willtim 7y agoIndeed and Haskell still has this issue today, because member access is a top-level function.
- marcosdumay 7y agoStill, it creates all kinds of problems for code generation (templates) and code by convention (as with generic). I have not seen a case of it creating problems where there weren't already plenty of other problems with the code and metaprograming had to be abandoned anyway. But it does create problems.
- int_19h 7y agoIt would make more sense if fields actually were functions, or at least function-like in syntax. Then again, OCaml still has module-scoped scoped record field names today, even though it also uses the dot syntax.