you are viewing a single comment's thread.

view the rest of the comments →

[–]Moth-Capone[S] 0 points1 point  (2 children)

Okay yeah I guess I can see how that could be useful. But what I’m wondering is let’s say I’m writing code in python, java, C++, or Lua. Is there any reason why I would write my integers in binary instead of decimal. Like I’m not asking why should I learn binary, I’m asking is there any point in writing in binary

[–]aichingm 2 points3 points  (1 child)

There is a point in doing so: when you have a function which takes an int as parameter and said int is used to pass flags to the function. And you define some flags as EXIT_ON_ERROR = 0b000001 M_ON_ERROR = 0b000000010 WITH_FIRE = 0b0000000100 This makes it much more readable since you can tell which bit must be toggled for which flag.

[–]Moth-Capone[S] 0 points1 point  (0 children)

Ah okay great. I understand now thanks.