Comment by vova_hn2
2 hours ago
I've read the requirements [0] section of the article and it doesn't contain anything that would prevent you from just storing all the flags in the decoder and using an id.
In fact, the article says
> With this (rather primitive) format I managed to encode 128 flags with varying success.
Which means that, actually, 7 bits would be enough.
So, this comment is (correctly) pointing out that requirements are imprecise.
You may find such "rules lawyering" obnoxious, but I think that in the real world tasks it is often useful to clarify such things, because it let's you avoid doing hard and complex work that is actually not needed.
I think that every experienced developer has this automatic response to reading a list of requirements: "here is a shortcut that will technically fulfill all the requirements. Please, either tell me that it is okay to do it, or update your requirements to close this loophole".
[0] https://read.vantezzen.io/miniflags#3d8e32040c2a808e8d95c8a0...
No comments yet
Contribute on Hacker News ↗