Re:RFC 6920: Naming Things with Hashes
by stcredzero on Saturday February 20, 2016 @07:38PM
(#11142712)
So, if we programmers are so advanced, why are we still using names to identify various programming language entities? Why aren't we giving the equivalent of UUIDs to Classes and Functions and other programming language entities? As it is now, there are version control systems that could well be confused by name collisions.
[ Parent
| on HN ]
Yeah, the idea of "let's serialize the ASTs and add names only when humans look at it" comes up all the time. There are also a few implementations, but editing it is just so different from text editing that the hurdle is quite big (and emulating text editing on top of it is really hard to get right, without loosing most of the benefits in the process).
example: http://www.lamdu.org/
Re:RFC 6920: Naming Things with Hashes
by stonogo on Saturday February 20, 2016 @07:45PM
(#11142736)
Because contrary to popular belief, source code is for humans. If we were after strict utilitarianism, we'd have switched to some MMIX-like abstract assembly with GUIDs as signifiers for all constructs.
This is actually one of the ideas underlying Microsoft's COM technology. Interfaces and classes had both names and guid identifiers. The guids were mostly hidden from programmers, and even when present they were #define'd to something more meaningful.
Re:RFC 6920: Naming Things with Hashes
by sdegutis on Saturday February 20, 2016 @08:14PM
(#11142818)
Because that defeats the entire purpose of naming things. Sure, the way we name stuff isn't perfect. But it's way better than the alternative of giving it random names. They'll be unmemorable, ungoogleable, difficult to map mentally to concepts, etc.