Hacker News new | ask | show | jobs
by hahamrfunnyguy 1112 days ago
I don't really understand the hurdle to "learning binary". It's not necessary to understand how binary works to complete a hello world program, but I think it's something that you want to get a handle on pretty quickly.

If I recall correctly, we only spent a few minutes on it in a larger lesson about different schemes for representing numbers in Comp Sci I. I don't think I've performed binary arithmetic since that class, but it's good to know how it works and I could always look up/figure out how to do those calculations again if I needed to.

2 comments

It's good to know how to eat healthy, avoid processed foods, maintain healthy sleep patterns, avoid PUFAs, maintain strong mind-muscle connection in the body, communicate effectively and succinctly and empathetically with others, and many other life skills as well. And they'd all make you a heathier, happier, more robust, performant human. Which translates to better productivity. Better code.

So, should this new programmer start there, or start with binary?

Honestly, learning binary isn't something that will take any significant amount of time. This is not a tradeoff you need to make.
I mean, you definitely Should be doing all that. 2 hours at the gym + suppluments + cutting out processed food + getting at least 150 grams of protein a day + drinking purified water have all contributed significantly to keeping my brain active and capable at 38.
How do you know that you wouldn't have the same capabilities if you didn't do those things?
3 years ago I weighted 210, had persistent fatigue and chronic pain. now I'm 187, and feel better than when I was in my 20's. Its made a difference.
38 here as well. Agreed on all counts except the need for supplements if you're eating grassfed beef, lamb, organs (liver, etc) and other high quality whole foods. Also 180g protein for me, since I weigh 205lbs.
> So, should this new programmer start there, or start with binary?

The new programmer should start with the life skills. As a toddler. They should also learn the alphabet and how to wipe their own ass. Why do you think this is a gotcha question?

By your own admission you have never used the knowledge you learned.

Why exactly is it “good to know how it works” if you literally have never used that knowledge? Why is it “something you want to get a handle on pretty quickly” if you don’t touch binary?

Are there places where it would come up? Most certainly. Is it required learning for every single dev out there? Highly debatable.

I've certainly benefited from knowing about floating point error. I likely would have spent a lot of time confused about why certain kinds of math kept coming out wrong without know about the underlying representation of floats, how it results in error, why this tradeoff is good for most scenarios, and other options.

The problem is that this is the sort of foundational knowledge that isn't easily gained through the learn-as-needed approach that applies to higher level things. Most people can notice when they don't know how to use a library. It's probably not obvious to most people who don't already know about it that their computer can handle numbers wrong.

> It's probably not obvious to most people who don't already know about it that their computer can handle numbers wrong.

0.1+0.2=0.30000000000004 is not obvious? When a floating point error happens, it’s quite plainly obvious. At that point, someone would look up a SO article like https://stackoverflow.com/questions/588004/is-floating-point... and learn about it. And from there, FPE mitigations.

Would you get to the mitigations faster if you knew binary? Sure, the first time you ever hit it. But that seems to be bottom of the barrel optimization, IMO.

Most manifestations will be in the middle of something more nuanced than a demo statement, the people in question will often lack the vocabulary to describe what they're seeing, and it's rarely anyone's first or even fifth thought that addition is going wonky. With that in mind, I think it's perhaps a stretch to call floating point error plainly obvious.

You're right, of course. This would be only marginally faster if the person knew binary. That said, there's a large swath of very similar things that crop up where the person benefits from a familiarity with the fundamentals of computing. There's enough of these things that a reasonable person might conclude that a software engineer benefits from such a knowledge base inside their head. That way a person can benefit from all those marginal gains at once.

The example is overly simplified, sure. But even if it’s in the middle of a swath of other operations, it will still result in very similar behavior. You’re likely never to get a clean number once a floating point error happens, and the result will be slightly off and seem to not be rounded.

Searching “why is my arithmetic operation not rounded”, I got https://docs.python.org/3/tutorial/floatingpoint.html as the third answer. I obviously can’t unlearn what floating point arithmetic is, but it feels like someone without any knowledge of it would likely be able to get a similar result relatively quickly as long as they are good at searching for answers (a much more important skill, IMO, which should be considered foundational)

> That said, there's a large swath of very similar things that crop up where the person benefits from a familiarity with the fundamentals of computing.

We’re talking specifically about binary, not fundamentals in general. Some fundamental knowledge is more important than others, and I posit that binary is on the lower end of that spectrum.

IMO, being good at searching is a skill that's only really useful when you have some idea what kind of question you're looking for an answer to.

I don't think we're actually talking specifically about binary. I am treating the reference to binary as a stand-in for the mathematical fundamentals of computing, rather than a narrow comment on understanding binary and bitwise operations.

> Highly debatable.

For the sake of debate: call me old-fashioned, but I don't ever want to rely on code from a "developer" who isn't familiar with binary notation.

How does knowing binary produce meaningfully better code? Most of us aren't working at a low enough level for it to be substantial.

You should be judging the code, not the person who wrote it.

For nearly all of the software I rely on, I haven't examined the code. I'm not in a position to judge it.

For most of that software, of course, I'm not in a position to judge the developer either; but if all I know is that the developer isn't familiar with binary and hex, then I wouldn't expect her to be competent to write, for example, a brochure website, let alone a webserver. URL encoding depends on hex. Debugging often depends on hex. Arithmetic overflow and carry are binary. Twos-complement notation for signed integers is a binary convention.

I wouldn't hire a developer who couldn't explain binary notation. In fact I don't think I've ever met one like that.

As I suggested, perhaps I'm old-fashioned.