3 ms·
the name of an executable is like a global variable the instant it is used as data; it can be changed at any time by someone else and then behavior changes. na
by naikrovek 4y ago
the name of an executable is like a global variable the instant it is used as data; it can be changed at any time by someone else and then behavior changes.
names are not data. don't make them data.
names are names.
- cryptonector 4y agoUsing argv[0] for dispatch has worked for 4+ decades. There is zero non-contrived evidence that it ever fails to work. Further, there's 4+ decades of legacy here, and it's very rude to break backwards compatibility with something like this where there's no need, no security vulnerability that must be fixed by breaking backwards compatibility.
- naikrovek 4y agoI'm not saying it doesn't work, I'm saying that relying on it being a certain value, or one of a set of values, is like relying on the value of a global variable. we avoid that in software development-land whenever possible, and for good reason.
- cryptonector 4y agoYour point is moot given that this works and has for decades, and you concede that point. > we avoid that in software development-land whenever possible, and for good reason. We also avoid breaking backwards compatibility unless it's really necessary. In this case, granting your premise for the sake of argument, the harm caused by this change exceeds the actual non-harm of the thing you're objecting to regardless of the theoretical badness of that thing.