4 ms·
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 UU
by stcredzero 11y ago
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.
- stonogo 11y agoBecause 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.
- detaro 11y agoYeah, 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/ http://www.lamdu.org/
- SFjulie1 11y agoBecause "real words" kind of add an extra level of redundancy for the meaning. Like Apple pie on a menu is way more convenient than a random number and then the description of the ingredient. I don't think it aims at changing all URI. It seems to be a way to obfuscate the address space in order to prevent attack by "educated guess". like if your UID is a monotonical growing number you can access another account by checking your predecessor. httpS://mi6.gov.uk/007/my_profile Don't laugh I actually have been ordered to build quite a few website with flaws like this against my advice where you could access others' profile's information to keep my job. It seems to me a wrong technical answer to an education problem. Using whatever kind of hash you want to give the attacker a 1/2^(whatever_big_power) protecting yourself from brute force attack to access a hidden (non authed) resource does not beat making sure people access information with the right credentials. It clearly is a "statistical way" to remove the need for authentication if the "hash" is given by another channel. Because statefull connections (https + auth + cookie + redirect) are expensive. (REST with auth is basically statefull). It is a statistical bet relaying on the premise that your random number generator is not predictable, hence ... not testable :) Which is crazy. Application: you are given a token (aka a random number or a hash) by a server and you use this normalized token to reference access to resources (either in input or output). It is not SciFi, it is in the rationale of the abstract. Hash function outputs can be used [..] to a specific resource or to make URIs hard to guess for security reasons. And with a hash big enough, you don't have to care about the risk of your session to be used... or maybe you should care. It looks like something an Oauth2.0 fan boy could have come with.
- sdegutis 11y agoBecause 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.
- bmm6o 11y agoThis 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.