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

Code quality improvement of ETA.NET samples #229

Open
vokounjan opened this issue Dec 29, 2022 · 1 comment
Open

Code quality improvement of ETA.NET samples #229

vokounjan opened this issue Dec 29, 2022 · 1 comment

Comments

@vokounjan
Copy link

vokounjan commented Dec 29, 2022

First of all I would like to thank you for your work on the new Real Time SDK. We already use a solution based on RFA.NET in our organization, but we would like to use it on UNIX OS, so your work is very much appreciated.

However, I have been spending the last few days going through and working with the samples provided and I believe that there is quite a lot of room for improvement in the quality of the code which would significantly help other developers.

I had a similar experience a few years ago when I was working with samples based on RFA.NET, but the current experience is even more significant given the evolution of programming standards and the elegance of the new .NET (Core) framework.

I understand that samples are not meant to be production ready, but I believe that the following modifications would significantly help in understanding and therefore better adoption by other developers:

  • Use of dependency injection and limiting cross-class modifications. For example, the logic between handlers from EtaAppCommon project is not entirely straightforward and the examples make it even more difficult to understand due to unclear dependencies in the code.

  • Use of unified logging instead of calling Console.WriteLine().

  • Limiting the use of StringBuilder (and in particular sending it as a parameter to other functions) for logging purposes. It is very difficult to trace where which values come from. Non-printable characters (\n, \t) don't help code readability either.

  • Adherence to proper naming conventions. A couple of examples that occur in the code that are in conflict with Microsoft guidelines:

    • Unnecessary abbreviations (Msg instead of Message, wle instead of WatchListEntry, pu instead of PostUserInfo, etc.)
    • Conflicting names (e.g. Int, Double, Float and other classes from Refinitiv.Eta.Codec namespace)
    • Variable names that don't have any meaning (ret)
  • Using pure functions where possible. Many functions from the samples depend on class members or modify input parameters quite unnecessarily which also make more difficult to trace the code flow.

  • Reducing the number of nested if-statements.

  • Use of event-driven programming/callbacks instead of calling Task.Delay() in loops.

Thank you,
Jan

@L-Karchevska
Copy link
Contributor

@vokounjan We appreciate your feedback! An internal Jira was created to look into it.

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

2 participants