Author Topic: Different formats are indistinguishable  (Read 6087 times)

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Different formats are indistinguishable
« on: November 25, 2012, 02:25:45 pm »
Guys, during debugging, in watches window:
a) there is no way to tell if value of variable is displayed in bin, oct, hex, dec.
b) this is just suggestion, but I think it could be nice if those colums in watches were named, like for example:
id , value, type.

Is there any patch which would allow to make those formats distinguishable in watches window, and does anyone of you finds it bit inconvenient and worth changing/updating/improving?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Different formats are indistinguishable
« Reply #1 on: November 25, 2012, 02:45:09 pm »
Right click the value and chose properties from the context menu.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #2 on: November 25, 2012, 03:21:58 pm »
Right click the value and chose properties from the context menu.

Hi, thanks for your reply. I know I can do it. The problem I have is this scenario:

a | 10111 | int
b | 10111 | int

Which one of them is binary and which in decimal? Is any of them in dec/bin? You simply cannot tell. And if you have many of them and some of them are set to be display in bin and some of the are in dec, then you simply are lost and each and every time you have to check by right click and selecting Properties. This is just bad and counter productive. That's what I think anyway.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12081
    • Travis build status
Re: Different formats are indistinguishable
« Reply #3 on: November 25, 2012, 03:53:02 pm »
Guys, during debugging, in watches window:
a) there is no way to tell if value of variable is displayed in bin, oct, hex, dec.
Probably doable, but it will require some play around with wxpropgrid...

b) this is just suggestion, but I think it could be nice if those colums in watches were named, like for example:
id , value, type.
It is possible, but then a row of text will be wasted. So, I'm against such change. Also the columns are pretty obvious :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #4 on: November 25, 2012, 04:04:07 pm »
It is possible, but then a row of text will be wasted. So, I'm against such change. Also the columns are pretty obvious :)
[/quote]

Then I propose to make this optional. If one doesn't mind to have one row of text wasted this could be on. On the other hand if someone minds it, then this could be off. What do you think?

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #5 on: November 25, 2012, 04:10:47 pm »
Also I think that some "global" settings should be allowed. What I have in mind is that if in the scenario:
a| 1010| int
b| 1101| int
c ...
.
.
.
n ...

I decided that I want to have all of them in one format I should be able to do it with single command. As the things are now I need to do it separately for each variable. It is simply tedious.
Another thing that I observed while working on my last project is that the leading zeros are not displayed. I'm not sure if that's the wise/correct design decision. Sometimes you can simply by looking at length tell if those types are identical (size wise) etc. Also if you for example are ok with this behavior, then it should be made optional - display/don't display leading zeros. Separate them/Don't separated them, here what I have in mind is:

a|1001 0101 0100
is much more readable than:
a|100101010100

Any opinions?

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Different formats are indistinguishable
« Reply #6 on: November 25, 2012, 04:16:18 pm »
For distinguishing the format, wy not use prefix "0b" for binary and either "0" or "0o" for octal (the latter only if octal would be available, what it is not at the moment). A prefix for unsigned would also make sense ("u").
Without looking at the code, I would say it should not be too hard to implement, but I might be wrong.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #7 on: November 25, 2012, 04:20:27 pm »
Hi Jens

0b for binary - I thought exactly the same
0x for hex - I believe that there will be no argument on this?

I don't really think that there is a need to do prefix for unsigned/signed - this is already provided in type column and is not consistent with 0x etc because once (0x) one is presented with format and second time (u) one is presented with type.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12081
    • Travis build status
Re: Different formats are indistinguishable
« Reply #8 on: November 25, 2012, 04:32:01 pm »
I doubt it would be easy this way...because you can set the formatting for pretty random staff.

About the header: I prefer to not have another option.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #9 on: November 25, 2012, 04:36:52 pm »
About the header: I prefer to not have another option.

Well, then you are imposing your preferences on others which may have different preferences to yours. This option could be off by default and you simply don't have to use it if you don't want to, nor even see it. But if someone wants to have the columns titled, why should this be refused to this person, especially if it doesn't disturb the way you work?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12081
    • Travis build status
Re: Different formats are indistinguishable
« Reply #10 on: November 25, 2012, 04:51:16 pm »
Because it adds more maintenance cost for very little added value.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #11 on: November 25, 2012, 04:55:18 pm »
Because it adds more maintenance cost for very little added value.
You are of course right in what you're saying. But there is also something to gain from having well designed interface.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Different formats are indistinguishable
« Reply #12 on: November 25, 2012, 05:04:19 pm »
Hi Jens

0b for binary - I thought exactly the same
0x for hex - I believe that there will be no argument on this?
"0x" is already there.
I don't really think that there is a need to do prefix for unsigned/signed - this is already provided in type column and is not consistent with 0x etc because once (0x) one is presented with format and second time (u) one is presented with type.

You should try what happens if you watch a negative int and switch it in properties ti unsigned.

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #13 on: November 25, 2012, 05:19:22 pm »
Quote
You should try what happens if you watch a negative int and switch it in properties ti unsigned.
Then I believe it should be indicated in type column, like:
a|425156|int -> unsigned

It would simply mean consistency has been preserved. But I also see the possibility of having:
a|425156u|int
Note the postfix, which is somewhat consistent with C++ literals, 10ULL etc.
What is your opinion?

Offline smallB

  • Almost regular
  • **
  • Posts: 193
Re: Different formats are indistinguishable
« Reply #14 on: November 25, 2012, 05:33:26 pm »
Jens
I've also observed that there are inconsistencies in behavior while displaying values. Try to change the value to be displayed as a char. What happens is that you have the original value and the char representation. This is inconsistent, because you don't have original value displayed when you have type changed to unsigned.

Anyway, I believe that it would be really nice if this could be fixed and normalized.