today I'm thinking about why it's useful for someone who mostly works in higher-level languages (python, JS, scala, etc) to understand how computers represent things in bytes.

some ideas I have so far:

- reading the output of strace
- doing back-of-the-envelope storage calculations
- choosing the right size for a DB primary key (to prevent overflow)
- knowing the limits of JS numbers
- optimizing algorithms (like knowing that multiplying by 2^n is fast)
- debugging encoding issues

what else?

I'm also curious about whether there's ever a reason to understand how two's complement works (I'm sure it's cool but I've never needed to learn it so far, only that signed and unsigned integers are different)

Follow

@b0rk Maybe knowing that they are bit-identical on the intersection of their ranges is ~directly useful? Also, that addition is the same bitwise operation on both. Once you know these two things, you know everything about 2-s complement (you can infer how any value is represented).

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.