Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QoL - Microsoft.Bot namespace collides with Bot class name #113

Closed
drub0y opened this issue Feb 14, 2018 · 5 comments
Closed

QoL - Microsoft.Bot namespace collides with Bot class name #113

drub0y opened this issue Feb 14, 2018 · 5 comments

Comments

@drub0y
Copy link
Contributor

drub0y commented Feb 14, 2018

Because the root namespace is Microsoft.Bot and there is a class named Bot, there is no way to use the plain class name in code without either aliasing it or prefixing it with the Builder namespace. That means that a new user sitting down and writing the following code:

Bot myBot = new Bot(...);

Will immediately run into errors with intellisense finding the class and putting red squigglies under the class name, and the following compile time error:

Error	 CS0118 'Bot' is a namespace but is used like a type

Instead you are forced to use either explicit namespace scoping:

Builder.Bot myBot = new Builder.Bot(...);

Or you would have to alias the Bot class to a name that doesn't collide like:

using BotIMean = Microsoft.Bot.Builder.Bot;
.
.
.

BotIMean myBot = new BotIMean(...);

This is going to be a problem for those who just sit down to use the SDK for the first time and also seems like a silly thing to have to constantly work around. Either the namespace could be renamed to something like Microsoft.Bots or the class could be renamed, but that seems less appropriate since that really is the "thing" that the noun represents.

@cleemullins
Copy link
Contributor

This is (and has been) driving me nuts as well, and is polluting all my code.

I'm working with the folks on the other languages (JS, etc) to see if we can figure out a single namespace / name that will work across all the platforms. That's not as simple as you would hope.

Stay tuned!

@justinwilaby
Copy link

justinwilaby commented Feb 15, 2018

we should consider using the name: class BotBuilderBotThatUsesMiddlewareAndPluginsToPostAndReceiveActivities {} In case there is ever an Objective-C port in the future. ;)

@cleemullins
Copy link
Contributor

There's also the Lisp Variant:
(((((((((((((((((((((((((((b(((((((((((((((((((o(((((((((((((((((((((((((((t))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

@garypretty
Copy link
Contributor

Don't let anyone say we don't have any fun around here.

@cleemullins
Copy link
Contributor

With the recent change (#145 ) the Bot+Adapter, the "Bot" class is now gone. This has the happy side-effect of making this issue go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants