Dominic
Nov 2, 2024

The first way is simpler and significantly more performant and memory efficient. I’d change to an enum which is more type safe (takes up 24 bytes + 24 for each entry in Java but in a proper language would typically be 4 bytes in its entirety) and an exhaustive switch.

Dominic
Dominic

Written by Dominic

Tech fatigue? Nope. I love reading about new frameworks and languages and dabbling

No responses yet