I think back to many tutorials and code snippets in which I have seen variables, functions, and files with "my" or "my_" prepended. What is the origin of this convention?
1 Answer
Origin? ...I think that comes from simple human interest in taking topics out of the specific and into a more general context, in that, at least when I do this myself (which is mostly every time I share ANY code in a public forum), I, as the old Dragnet TV program used to say "change the names to protect the innocent." It's not any more complicated than that!
This is ESPECIALLY true of people asking questions in the Stack Exchange community: MOST of us work in environments where whatever we're working on is at least SOMEWHAT concerned about privacy; we don't want to inadvertently, much less intentionally, share information that we may very well have non-disclosure agreements covering! This could be code we're writing for a client or for a corporation, etc...
Don't over-think it!
-
This is asking about a naming convention found within documentation, which is generally public, so the tangent about NDAs is mostly irrelevant. And the rest is armchair speculation. Commented Aug 8, 2022 at 13:39
-
@user3840170 Speculation? Surely. But, first, you apparently overlooked my initial paragraph and focused on the second. And ... where do you think documentation comes from? Hint: Mostly it's from engineers / code developers who actually perform the work, and, even when written by professional writers they get a LOT of documentation material from engineers who provide them examples... Speaking from experience, I am not wrong, however, it's SURELY speculative what "origins" were. And, I directly said the NDA issue often applies to Stack Exchange-like sites. Commented Aug 8, 2022 at 19:19
strlen
vs.my_strlen
)