Should I Use Hexadecimal?

Should I Use Hexadecimal?

The main reason why we use hexadecimal numbers is because it provides a more human-friendly representation and is much easier to express binary number representations in hex than it is in any other base number system. Computers do not actually work in hex. Lets take an example, using a byte.

Is hexadecimal better than decimal?

Hexadecimal would be better as it would take less digits in hexadecimal than in decimal. Binary would be better as it is simple and less complex.

Is hexadecimal more efficient?

There is absolutely no performance difference when writing constants in your code in decimal vs. hex. Both will be translated to the exact same IL and ultimately JITted to the same machine code.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.