-
Notifications
You must be signed in to change notification settings - Fork 3
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
Clumsy Code #8
Comments
|
I tell you that I completely rewrote your code. It is much shorter and clearer now. (approx half the length of yours). I also fixed some other issues. |
Looking forward to your project. If you already fixed my code, you could also create a pull request. |
I did not fix your code. |
1.)
There is no reason to use a GCHandle in your code.
If you read the documentation that this is for the opposite purpose: When UNmanaged code accesses Managed resources.
But you not do this in your code.
2.)
There is absolutely no need to ever use the keyword "unsafe" in your code and require to compile you code as unsafe.
3.)
It does not make sense to use hundreds of "async" and "Task" if you use "await" in the same function.
You did not understand asynchronous programming.
If you use "await" in the same function you block the calling thread. This is not asynchronous programming anymore.
The idea of asynchronous programming is that one thread waits for another and not one function blocks itself.
4.)
Why pass a CancellationToken to each and every function if you have a timeout of 1500 ms ?
Who will ever cancel such a short operation ?
The text was updated successfully, but these errors were encountered: