garnet icon indicating copy to clipboard operation
garnet copied to clipboard

LightClientRequest very bad coding habit

Open ShaolanTech opened this issue 1 year ago • 1 comments
trafficstars

Describe the bug

LightClientRequest is simple, but very import, and many code will be depend on it in the future. Your team should consider recoding this class by some experienced engineers, but not a student or a junior programmer. by simple reviewing the code, i found lots bad coding habits, for example: arbitrarily allocate array with "new", and concate string with "+".

Steps to reproduce the bug

1.just open LightClientRequest.cs

Expected behavior

consider to use ArrayPool and ReadOnlySpan

Screenshots

图片 图片

Release version

v1.08

IDE

No response

OS version

No response

Additional context

No response

ShaolanTech avatar May 12 '24 03:05 ShaolanTech

Be the change you want see in the world and submit a PR 😉

PaulusParssinen avatar May 12 '24 04:05 PaulusParssinen

Not every code fragment you see in a repo is part of what goes into production. There are usually prototypes, test code, code for benchmarking, etc. that are there to achieve narrow purposes. LightClient in particular is only used in this way. As Paulus mentions, happy to receive pull requests.

badrishc avatar May 12 '24 06:05 badrishc