Refactoring Code
Max Samukha
maxsamukha at gmail.com
Sun Mar 3 09:47:28 UTC 2024
On Sunday, 3 March 2024 at 07:30:53 UTC, Walter Bright wrote:
> 1. no need to manually verify that the array is in the same
> order as the enum.
Fair.
>
> 2. no variables are declared
True.
>
> 3. there's no concern about thread safety with the static
> variable initialization
The array doesn't need to be lazily initialized (unless I miss
some important detail).
>
> 4. no cast conversion, which has to be checked manually
Right.
I could list a number of random points in favor of the original.
More information about the Digitalmars-d
mailing list