Hacker News new | ask | show | jobs
by thosakwe 2927 days ago
Believe it or not, I didn't even consider that. That's definitely a better way to do it.
1 comments

Was the first thing that stood out to me as well. Toggled modes like this are also quite annoying when shuffling around sections of the file. Copy one hex too many and suddenly your numbers in another part are all wrong. And due to the toggle you'll have a hard time finding the place where it all went wrong.

As far as I could tell it's been more or less the only mode. At that point I'd probably get rid of it because global state (which modes are) has to be remembered at all times and in this case its invisible until you see output. The suggestion to use different operators or modifiers for a single numbers was a good one in that direction IMO.

In addition, global modes lead to hairy things like

    if ...
       hex off
    endif