Google solved consistent hashing in just 5 lines of C++
John Lamping and Eric Veach designed it to map keys to buckets with almost no memory
when a bucket is added, only about 1/n of the keys move
the entire algorithm is a tiny loop using a 64-bit LCG and the constant 2862933555777941757ULL
O(ln n) expected time, O(1) memory
At work, I gave a talk to newly joined college students on graphics programming - how the elements we see and interact with on screen are designed, built, and ultimately rendered by a computer.
If you want to go deeper, "Introduction to Computer Graphics" by David J. Eck is one of the best free resources out there - full textbook, interactive demos, covers everything from 2D basics to WebGPU.
https://t.co/W14ifMI7Jw
Google researcher @lauriewired warns the shift from C++ to Python in universities is creating programmers who don't understand how computers actually work:
"When I was in college getting my CS degree, my year was one of the last years that was using C++ as the core language for teaching students. Actually they were switching over to Python of all languages."
"One of the biggest issues that I have is that a lot of these higher level languages are really abstracting away what is happening under the hood. If you're not aware of how the computers work in general, then you're gonna have problems when it comes to debugging."
"Starting with a language like C++ gives you the ability to do these really high level abstractions, but it also gives you the ability to customize your memory management and get really close to the underlying machine. Especially if you're trying to work in high performance computing, game development, or high frequency trading."
"At C++ conferences, there's almost this fundamental anger response when it comes to mentioning something like C or C++. People start complaining about the complexity of it."
@Google