Get yourself a picture of the code conventions by just browsing the source code. Feel free to ask any question in discord.
- Stick to the Microsoft Code Conventions
- Stick to the Microsoft Secure Coding Guidelines
- Comment classes, methods and properties
- Use HTML tags within the comments
/// <summary>
/// Handles all default <see cref="Packet"/>s that are in the library.
/// </summary>
/// <param name="packet">The <see cref="Packet"/> to be handled.</param>
private void HandleDefaultPackets(Packet packet)
{
- Favor one-liners over multi-lines
public virtual long RTT { get; protected set; } = 0;
protected override void CloseHandler(CloseReason closeReason) => Close(closeReason, true);
- An if/else with a one-line body has no brackets
if (!packetPropertyCache.ContainsKey(type))
packetPropertyCache[type] = PacketConverterHelper.GetTypeProperties(type);
- Use regions for variables, properties, events and methods. Even add arbitrary regions to facilitate the understandability.
- Modifiers: private > protected > internal > public. Mark each class/property/method as close to the left as possible. Any internal logic shouldn't be visible to the public.
- SourceCode is buildable
- Code Quality Factor equals the Master-Branch
- Corresponds to one specific task/issue
- Less is more. Large PR are likely to be rejected
- Reformat/refactor existing code; just for visuals
- PR without existing issue/task
- Addressing more than one issue/task
- Replacing or adding extrenal dependencies