Fortnite-API/csharp-wrapper

Remove aliasing of `JsonProperty`.

tacosontitan opened this issue · 3 comments

Throughout the models defined in the project, the JsonProperty attribute from the Newtonsoft.Json NuGet package is aliased as simply J:

using J = Newtonsoft.Json.JsonProperty;
...
[J] public string Value { get; private set; }

This effectively obfuscates the code in this use-case. Best practices in the C# language demonstrate that aliasing should be primarily utilized to prevent ambiguity, which is not present in the project (from what I've seen so far).

I'd like to propose removing the aliasing:

using Newtonsoft.Json;
...
[JsonProperty] public string Value { get; private set; }

While this is more verbose, it creates more legible code. From a performance perspective, there is no difference between the two as aliasing is simply syntactical sugar to help with ambiguity where it can't be avoided by other means (e.g. the model names are out of your control).

I don't mind taking this issue on through a fork and a pull request, if approved.

Hi, i dont see why this would be a good idea for this project since im the only one who maintains it.

Fair enough; just thought I'd mention it. 🙃