Oh yes, a good example is setting a magic value to a registry [1] to make sure your microcontroller (in my case, an ESP32-S3) wouldn't reboot because of the watchdog.
At first, I was confused on the behavior - after reading the datasheet and setting the magic value, it all made sense. I'm pretty sure it will look like wizardry to the next person looking at the magic value alone.
Thankfully code comments are a thing, but magic values are still magic values.
Comments
Oh yes, a good example is setting a magic value to a registry [1] to make sure your microcontroller (in my case, an ESP32-S3) wouldn't reboot because of the watchdog.
At first, I was confused on the behavior - after reading the datasheet and setting the magic value, it all made sense. I'm pretty sure it will look like wizardry to the next person looking at the magic value alone.
Thankfully code comments are a thing, but magic values are still magic values.
[1]: https://github.com/tinygo-org/tinygo/pull/3937/files#diff-8f...