It’s 9:31, do you know where your bits are? A lot of real time clocks use binary coded decimal or BCD to store the time. BCD isn’t a common format but you will probably run into it at some point. This time, we look at BCD and how to convert it to binary.Read More
In a previous post, Andrei discussed the switch statement. In this post, he gives a more indepth review of switch and then deeply dives into the default case.
Rather than just leaving it out, default can be used to detect the impossible. Read on to handle whoopses, neutrino hits, and beer. And remember, be assertive, but be kind to your future self.Read More
Andrei found a horrible bug in the execution scheduling code that he has been using for years. Here is an exploration of the bad code, how to fix it, and the nature of unsigned integer overflow.Read More
Frequently, we talk about how a little compassion and respect for the future can make a big difference for code quality. I purposely avoided many specifics to focus more on the motivations for taking greater care with our work. This week, I’d like to address something very specific and perhaps something that could form a foundation for writing better code.Read More