TDD
const max12 = (x, y) => {
if (x === 1 && y === 2) {
return 2;
} else if (x === 7 && y === 4) {
return 7;
} else {
return x;
}
};
TDD
const max12 = (x, y) => {
if (x === 1 && y === 2) {
return 2;
} else if (x === 7 && y === 4) {
return 7;
} else {
return x;
}
};
It’s even cooler than lightbulbs, though (assuming we’re talking about incandescents) - you send electricity back and forth into a wire that’s just the right length, and (RF) light leaks out without it getting hot!
Got my first programming experience on the BBC Micro at school! (We never had anything as fancy as a Master though). Those heavy cube monitors and the “beep-boop” startup sound are iconic.
Yes, CTEs are awesome. Especially when you don’t force materialization and the optimizer can work its magic.
I’ve had a lot of fun with window functions as well.
Um, actually… A signed 32-bit counter would loop back to December 1901, so the calendar is presumably 31-bit unsigned. (Sorry)
There’s always the classic C strcpy :)
char *strcpy(char *dest, char *src) {
char *p = dest;
while (*p++ = *src++);
return dest;
}
It’s fascinating to read these in-depth retrospectives from the people who were actually involved.
Nothing followed by the sound of a lot of cars leaving the Facility very fast.