NauticalGent
Ignore List Poster Boy
- Local time
- Today, 01:02
- Joined
- Apr 27, 2015
- Messages
- 6,673
I was putzin' with ChatGPT and asked her (don't judge me!) what a word (COLSETVERSION) in a connection string meant. She replied with ease so I challenged her to another word in VBA we all use and asked her why MS settled on this word in particular: "Me."
Her answer:
That’s an excellent and intriguing question! The choice of Me as a keyword in Access VBA (and in other VBA environments like Excel or Word) may seem a bit arbitrary at first glance, but it’s rooted in both historical and conceptual reasons influenced by object-oriented programming (OOP) conventions.
So, in essence, the decision was a blend of usability, readability, and linguistic intuition, making it a hallmark of VBA's user-friendly design!
Her answer:
That’s an excellent and intriguing question! The choice of Me as a keyword in Access VBA (and in other VBA environments like Excel or Word) may seem a bit arbitrary at first glance, but it’s rooted in both historical and conceptual reasons influenced by object-oriented programming (OOP) conventions.
Why "Me"? The Rationale
- OOP and Self-Referential Keywords:
The Me keyword in VBA is conceptually similar to this in C-like languages (e.g., C++, C#, and Java) or self in Python. It provides a way for an object (in this case, a form, report, or class module) to reference itself.
Microsoft likely chose Me because:- It is intuitive in conversational English—"Me" refers to oneself, just as the object refers to itself in code.
- It’s short and easy to type, a practical consideration for programmers writing repetitive code.
- It aligns with natural language programming design goals that were popular at the time VBA was developed (early 1990s), aiming to make coding feel more accessible to non-developers or power users working with Office products.
- Historical and Visual Basic Legacy:
VBA (Visual Basic for Applications) evolved from earlier versions of Visual Basic, where simplicity and ease of learning were core design goals. Microsoft has historically focused on creating user-friendly development environments. The choice of Me reflects this focus, as it resonates with non-programmers who may use VBA to enhance Office applications. Unlike more abstract terms like this or self, Me is immediately understandable in plain language, fitting the approachable nature of the language. - Consistency Across the Office Ecosystem:
Using Me across all Office applications (Access, Excel, Word, etc.) helped maintain a consistent programming model, making it easier for developers to move between these environments without having to learn different self-referential terms.
Why Not "This" or "Self"?
- "This" is used in C-derived languages, reflecting the need for distinguishing context in strongly object-oriented programming.
- "Self" is common in languages with a more academic or purist approach to OOP (e.g., Smalltalk, Python).
Conclusion
Microsoft likely settled on Me for its approachability, consistency, and plain-language simplicity. It reflects their user-centric design philosophy in the early days of VBA’s development. It's short, easy to understand, and fits the metaphor of referring to "myself" in code.So, in essence, the decision was a blend of usability, readability, and linguistic intuition, making it a hallmark of VBA's user-friendly design!