-
Notifications
You must be signed in to change notification settings - Fork 10
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
Start coding style guidelines #4
Comments
@BillWagner, would also be nice to have some guidance here on naming conventions as well, in particular, around how Queries, Commands, Notifications and Handlers should be named when using MediatR. Do you want me to take an initial crack at those conventions? They would be similar to how commands and events are named for NServiceBus. aka... a command is in the present tense and is an order: an event (in MediatR's case, a Notfication) is in the past tense and says something has been done: I'd also like to drop the convention of naming class files for message with the name of the type of message they represent. aka, for Queries, we might want to think about prepending for Notifcations, since they're a message multiple subscribers are interested in, they represent an "event"... so something like And one more thing to consider. Do we want the word These changes might spur some renaming of existing MediatR messages and their handlers to something the coincide closer to the domain language of allReady and could lend some clarity to new contributors. In fact, where the word Async is used on the naming of a file could also go into conventions. The same thing for unit tests. Should all unit tests have the word @MisterJames actually recommended to me the other day to name my tests class names with "Should" at the end of the name... |
@mgmccarthy Great feedback. Yes, if you want to start a draft, based on what you've seen in the code so far, that would be fantastic. Also, pinging @MisterJames for his input on this item. |
@BillWagner where do I work on/store this draft? Can it just be a local word doc or is there somewhere I can work on this via GitHub? |
@mgmccarthy Just make a PR for this repo: https://github.com/HTBox/htbox.github.io Thanks for asking. |
We can also include what HttpStatusCode we should returning from our controllers that return HttpStatus codes (aka, "Web API" controllers, even though there is no such thing anymore in Core 1). Most of the recommendations are from people asking on StackOverflow: Not too sure what allReady's approach is to returning status codes, and I don't want to make any assumptions without guidance. |
Pinging @MisterJames for his thoughts. |
This should list the conventions we want to follow.
We should document that we want { } around all if / else clauses.
The text was updated successfully, but these errors were encountered: