Tag: code refactoring
Consider the following C/C++ function to count the number of trailing zeros for a integer (in binary form): static inline int count_trailing_zeros(int value) { int n = 0; while …
In one of my project, I have the following code (Node/Javascript) that invokes a few APIs one by one (sequentially). However, these HTTPS requests can be done in parallel …
This is a legacy code snippet that uses the magic goto, which I find it very difficult to understand and refactor. doit: foreach (var line in dict.Values) { var …
I am starting a series of code refactoring examples as I see them a lot from time to time. Today, I read the following piece of code in our …