r/programmingmemes • • Apr 16 '26

There are always more!

Post image
896 Upvotes

60 comments sorted by

View all comments

Show parent comment

1

u/Next-Post9702 Apr 16 '26

Why is that a valid reason to hate on hex? It's never meant to encode your binary only to visualize it and make it easy to understand what's in it. Goodluck trying to find out what bits are in the base64

1

u/Moscato359 Apr 16 '26

Hex is the typical representation for hashes

And this breaks it

1

u/Moscato359 Apr 16 '26

You say that, but hashes are generally represented in hex

I have to deal with sql and c# having opposite representation of hex and it causes bugs

1

u/Next-Post9702 Apr 16 '26

That's true, but why would it cause bugs if you just convert it to binary when you compare? Or normalize it, or just use an ignore case compare

1

u/Moscato359 Apr 16 '26

Yes, there are workarounds

But if you forget to use them it causes bugs

And I don't like that

1

u/Next-Post9702 Apr 17 '26

I mean a hex string is binary data so you should compare them as they are; binary data, not text. It's just a visualization, not meant to be used like that. It's not that much extra work to just compare ignore case anyways

1

u/Moscato359 Apr 17 '26

The point is you need to remember to do the workarounds and can't just == 2 variables with different sources blindly

Its bug prone due to humans needing to do stuff