r/Devs • u/Lounge_leaks • Apr 02 '20
EPISODE DISCUSSION Devs - S01E06 Discussion Thread Spoiler
Premiered on april 2 2020
212
Upvotes
r/Devs • u/Lounge_leaks • Apr 02 '20
Premiered on april 2 2020
View all comments
Show parent comment
1
u/PatrickBaitman Apr 04 '20
It does if you want to write performant and secure algorithms. It most certainly does if you're developing algorithms for numerics (in physics, or other fields), or if you're developing anything parallel (memory layout, communication) . And for quantum computing, any algorithm development will require understanding of quantum mechanics.
Yes, and the constant factor in front can be affected by things like memory layout. And how large datasets you can run your algorithm on is limited by (among other things) your available memory, measured in bytes typically, but if you don't know what a bit is, how are you going to understand what it means to have 1 GB available?
Good luck getting a CS degree or job without knowing what a bit is though.
If you want to have bugs and security vulnerabilities, yeah, you can. You shouldn't, though. For example, if you don't know how floats work, you might test for equality with
==or whatever its called in your language of choice. That's a bad idea, because, for instance,(a + b) + c = a + (b + c)is true for real numbers but not for floats. You might naively sum a list of floats, but that's numerically unstable, so's numeric dot product, etc.Your code might be entirely incorrect if you hit a numeric instability and leak all your clients passwords if you aren't careful about overflows, but yeah, you can manage.
I haven't read the spec but I do know the bit layout of an IEEE 754 float and the main things that can go wrong.
Arbitrary precision arithmetic is 100-1000 times slower than floats with hardware support. Maybe you need the precision because your problem really is that sensitive. Maybe you need a better algorithm, because it isn't and your first choice is just unstable. Comes down to the ones and zeros and data types that you claim programmers don't need to think about.
Yeah, that's called a "degree", you can get it from something called a "university", or you can obtain the same knowledge from "books" on your own.
I think you should be aware of things like pipelining, out of order execution, and especially vectoring of instructions. The nitty gritty details you can leave to the compiler, it will do better than you ever could.