top | item 17290183

(no title)

edudobay | 7 years ago

Cool idea! Clear and nicely organized too :)

Wouldn’t it be more readable and less error-prone to have separate commands for turning hex mode on and off? Such as `hex on` and `hex off`?

discuss

order

abtinf|7 years ago

I think it might be more intuitive as an explicit stream modifier: hex, decimal, etc. No reason to turn anything “off”, which is actually the activation of a diffferent mode.

Edit: What I mean is

  hex
  00
  dec
  00
  utf8
  00

thosakwe|7 years ago

Definitely, that's probably the best way, considering all the other commands are "stream-y" as-is.

thosakwe|7 years ago

Believe it or not, I didn't even consider that. That's definitely a better way to do it.

ygra|7 years ago

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.

stevekemp|7 years ago

It surprised me that an octal mode wasn't available, or a binary one. But that's a minor gripe.

The only other thing I could see being useful is the ability to define "structs", for binary-headers, etc.

But agreed, this is a neat tool.