by PennRobotics · 3y ago · 0 comments
// test if we need a<<8|b
// or (a<<8)|b
// or ((int)a<<8)|b
// or (((int)a)<<8)|b
#include <cstdio>
#include <cstdint>
int main() { uint8_t a = 2; uint8_t b = 38; printf("%d\n", a<<8|b); }
More than half of the time is the uninteresting parts: writing the includes, creating a temp file, exiting to compile, forgetting a parenthesis, reediting and resaving, compiling again, running, deleting...In a REPL---particularly one with stdio/stdlib included by default---this would take 30 seconds but instead takes 3 or 4 minutes. It's not much, but tight feedback loops really, really keep you in a great mental state.
No comments yet.