GPIOs are usually controlled by a single bit of a register anyway. Most likely you need to do something like:
// Set high
PORTB |= 1 << PINB5;
// Set low
PORTB &= ~(1 << PINB5);
GPIOs are usually controlled by a single bit of a register anyway. Most likely you need to do something like:
// Set high
PORTB |= 1 << PINB5;
// Set low
PORTB &= ~(1 << PINB5);
Not even else if? Damn, I guess we’re checking all the numbers every time then. This is what peak performance looks like
For NASA, data types don’t matter when you’re programming Voyager 1 and 45 years later it gets hit by an energy burst causing 3% of the RAM to become unusable, and it’s transmitting gibberish. It’s awesome they were able to recover it.
But then they’d have a dev team who wrote the code and therefore knows how it works.
In this case, the hackers might understand the code better than the “author” because they’ve been working in it longer.
It’s so easy! Watch:
{"contents": "<garbled .docx contents goes here>"}
I believe the lifecycle goes ExceptionLayer, ExceptionIncubator, ExceptionHatcher
It’s critical you don’t throw your exceptions too early, they need to learn to fly first 🤣
My biggest problem with it is that those aren’t verbs. You might have LegCount -> Countable and FleaCount -> Countable though.
I really enjoy programming, but generally I dislike cooking. I just want to eat, not spend time preparing to eat.
My experience with cooking has been that because I don’t do it enough, I’m constantly dealing with food expiration dates and having to plan carefully around them.
In comparison, I’ve got some servers that have been running maintenance free for 5+ years. (Probably not the most secure thing, but meh, I don’t have customers other than myself)
I think programmers often have hobbies that are more physical though. For me, I like working on my car because turning bolts and working with my hands lets my brain turn off for a while. I could see cooking and following a recipe being in the same category for others.
It really depends on what you’re measuring. Good luck measuring the distance from a corner if you can’t get 0 to touch the end.
Tape measures are almost always designed with this in mind, so you can hook the end over an edge, or butt it up against something and the measurement will be accurate both ways, since the metal end can slide in or out by just the right amount.
I have absolutely no clue what my highschool locker combination is, but I guarantee you if you handed me the lock, I could open it first or second try. That muscle memory is burned deep into my hands, and it’s been over 10 years.
All I see now is blonde, brunette, redhead.


Ah yes… several years ago now I was working on a tool called Toxiproxy that (among other things) could slice up the stream chunks into many random small pieces before forwarding them along. It turned out to be very useful for testing applications for this kind of bug.


And that’s where Release with debug symbols comes in. Definitely harder to track down what’s going on when it skips 10 lines of code in one step though.
Usually my code ends up the other way though, because debug mode has extra assertions to catch things like uninitialized memory or access-after-free (I think specifically MSVC sets memory to 0xcdcdcdcd on free in debug mode).
Neat, thanks for sharing. Reminds me of old mainframe computers where students and researchers had to apply for processing time. Large data analysis definitely makes sense for C++, and it’s pretty low risk. Presumably you’d be able to go back and reprocess stuff if something went wrong? Or is more of a live-feed that’s not practical to store?
It really depends what you’re doing. The last big project I did with C++ templates was using them to make a lot of compile-time guarantees about concurrency locks so they don’t need to be checked at runtime (thus trading my development time for faster performance). I was able to hide the majority of the templates from users of the library, and spent extra time writing custom static_assert messages.
C++ templates are in fact a compile-time turing complete language, as crazy as that sounds.
Yep, sadly I’ve been exposed to a few such codebases before. I certainly learned a lot about how NOT to design a project.
You’ve been at it longer than I have, but I’ve already had coworkers look at me like I’m a wizard for decoding their error message. You do get a feel for where the important parts of the error actually are over time. So much scrolling though…
Yep, I learned about this exact case when I got my engineering degree.
I guess you’ve never seen some of the 10-page template errors C++ compilers will generate. I don’t think anything prepares you for that.
I’m not sure how I feel about someone controlling an X-ray machine with C++ when they haven’t used the language before… At least it’s not for use on humans.
Bold move… Hopefully you’re not getting calls in 10 years when stuff breaks and you’re at a different company