• 0 Posts
  • 24 Comments
Joined 1 year ago
cake
Cake day: July 22nd, 2023

help-circle
  • It is important to know that these are books for computer scientists more than for software engineers. They are basically mathematics textbooks, about the mathematics of algorithms. They focus on proving theorems rather than implementing useful algorithms.

    There is a book called concrete mathematics that is sort of an introduction to TAOCP. If you’re interested in the basics that may be a good place to start. It has a better title than TAOCP in that it explicitly mentions mathematics, but also an equally bad one because it’s very much theoretical rather than concrete.









  • I think of std::any as a void* that retains type info.

    A typical use case for void* is user data in callback functions. If you’re writing a library that offers callbacks to client code, you may want to provide a way for the user to pass along their own data when registering a callback. Then when calling it, you return that data unmodified*. The library doesn’t know nor care what this user data is. Since the days of K&R C, this has been done with void*.

    But void* erases the type. The library may not care about the type, but the client code does. The only way to get the original type from a void* is an unsafe cast. std::any mitigate this.

    *edit: unmodified, not modified!





  • That’s a misconception. Farmers lobbied heavily against DST. Their work does not abide by the clock; they milk when cows need milking, and they harvest when there’s enough light, no matter what some clock says.

    In Europe, DST as we know it now was first introduced by Germany during WW1 to preserve coal, then abandoned after the war, and widely adopted again in the 70s. In the US it was established federally in the 60s.

    This is all glossing over a lot of regional differences and older history. But yeah, US farmers were very much against the idea.